/* ═══════════════════════════════════════
   玄灵大陆 · 剑仙坠落录 · 状态栏样式 v2.3
   水墨仙侠 + 朱砂玄玉 + 折叠功能 + 破甲映射 + 时空战略层
   
   v2.3 更新：
   - 新增 随身空间 字段专属样式（乾坤紫色调）
   - MOD 与 AI 视觉体系完全统一
   - 字段计数联动更新（主角23 / 白芷23）
   ═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   基础容器（ai 与 mod 共享同一套视觉体系）
   ═══════════════════════════════════════ */
ai, mod {
  display: block;
  --ink: #1a1614;
  --paper: #0f0d0b;
  --scroll: #1c1815;
  --gold: #c9a961;
  --jade: #7bc4a4;
  --cinnabar: #c04851;
  --pink: #d4788c;
  --purple: #9b7bc4;      /* 乾坤紫（随身空间专属） */
  --text: #d9c8a8;
  --dim: #8a7a5c;
  --line: #3a2f24;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(201,169,97,0.04), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(192,72,81,0.04), transparent 40%);
  color: var(--text);
  font-family: "KaiTi", "楷体", "STKaiti", serif;
  font-size: 14px;
  line-height: 1.75;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.7);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

ai::before, mod::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(201,169,97,0.015) 3px 4px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(192,72,81,0.01) 5px 6px);
  pointer-events: none;
  z-index: 0;
}

ai > *, mod > * { position: relative; z-index: 1; }
ai article, ai details, mod details { margin: 12px; }

/* ═══════════════════════════════════════
   正文叙事区
   ═══════════════════════════════════════ */
ai article {
  display: block;
  background: linear-gradient(180deg, rgba(28,24,21,0.9), rgba(15,13,11,0.95));
  border-left: 3px solid var(--cinnabar);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
  position: relative;
}
ai article::before {
  content: '❦ 卷 · 尘缘录 ❦';
  display: block;
  font-family: "STKaiti", "楷体", serif;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 6px;
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(201,169,97,0.2);
}
ai article::after {
  content: '❦ 一卷终 ❦';
  display: block;
  text-align: center;
  font-size: 10px;
  color: rgba(201,169,97,0.3);
  letter-spacing: 4px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed rgba(201,169,97,0.15);
}
ai article p {
  margin: 10px 0;
  padding: 4px 0 4px 12px;
  text-indent: 2em;
  border-left: 2px solid transparent;
  transition: border-color .3s, background .3s;
}
ai article p:hover {
  border-left-color: var(--cinnabar);
  background: linear-gradient(90deg, rgba(192,72,81,0.05), transparent 70%);
}

/* ═══════════════════════════════════════
   折叠面板
   ═══════════════════════════════════════ */
ai details, mod details {
  background: var(--scroll);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 12px;
  transition: all 0.3s ease;
  position: relative;
}
ai details[open], mod details[open] {
  border-color: rgba(201,169,97,0.4);
  box-shadow: -3px 0 0 var(--gold), inset 0 0 20px rgba(201,169,97,0.03);
  padding-bottom: 12px;
}

/* ═══════════════════════════════════════
   面板标题
   ═══════════════════════════════════════ */
ai summary, mod summary {
  padding: 12px 4px 12px 40px;
  font-family: "STKaiti", "楷体", serif;
  font-weight: bold;
  color: var(--gold);
  cursor: pointer;
  font-size: 15px;
  user-select: none;
  margin: 0 -12px;
  border-bottom: 1px solid transparent;
  letter-spacing: 3px;
  text-shadow: 0 0 4px rgba(201,169,97,0.3);
  transition: color .2s, text-shadow .2s;
  position: relative;
}
ai summary::marker, mod summary::marker { color: transparent; }
ai summary::before, mod summary::before {
  content: '❖';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cinnabar);
  font-size: 14px;
  text-shadow: 0 0 4px rgba(192,72,81,0.4);
  transition: transform .3s;
}
ai details[open] summary::before,
mod details[open] summary::before {
  transform: translateY(-50%) rotate(45deg);
  color: var(--gold);
}
ai summary:hover, mod summary:hover {
  color: var(--cinnabar);
  text-shadow: 0 0 6px var(--cinnabar);
}
ai details[open] summary,
mod details[open] summary {
  border-bottom: 1px dashed rgba(201,169,97,0.3);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════
   状态栏字段容器
   ═══════════════════════════════════════ */
ai sb, mod sb {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0;
}

/* ═══════════════════════════════════════
   单个字段行
   ═══════════════════════════════════════ */
ai f, mod f {
  display: block;
  padding: 5px 10px;
  background: rgba(201,169,97,0.02);
  border-left: 2px solid rgba(201,169,97,0.15);
  border-radius: 0 2px 2px 0;
  font-size: 13.5px;
  transition: all 0.25s ease;
  position: relative;
  color: var(--text);
}
ai f:hover, mod f:hover {
  background: rgba(201,169,97,0.08);
  border-left-color: var(--cinnabar);
  transform: translateX(3px);
  box-shadow: -1px 0 6px rgba(192,72,81,0.15);
  color: #f0e0c0;
}

ai f b, ai f strong,
mod f b, mod f strong {
  color: var(--jade);
  font-weight: bold;
  font-family: "STKaiti", "楷体", serif;
  text-shadow: 0 0 3px rgba(123,196,164,0.25);
  margin-right: 4px;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   随身空间字段专属高亮（乾坤紫色调）
   通过字段名匹配，兼容主角与白芷
   ═══════════════════════════════════════ */
ai f:has(b:contains("随身空间")) {
  background: linear-gradient(90deg, rgba(155,123,196,0.08), rgba(155,123,196,0.02) 60%, transparent);
  border-left: 3px solid var(--purple);
  box-shadow: -1px 0 6px rgba(155,123,196,0.15);
  position: relative;
}
ai f:has(b:contains("随身空间"))::after {
  content: '☯';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--purple);
  font-size: 14px;
  opacity: 0.5;
  text-shadow: 0 0 4px rgba(155,123,196,0.4);
  animation: qiankunSpin 8s linear infinite;
}
@keyframes qiankunSpin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}
ai f:has(b:contains("随身空间")) b {
  color: var(--purple);
  text-shadow: 0 0 4px rgba(155,123,196,0.4);
}
ai f:has(b:contains("随身空间")):hover {
  background: linear-gradient(90deg, rgba(155,123,196,0.15), rgba(155,123,196,0.05) 60%, transparent);
  border-left-color: var(--purple);
  box-shadow: -1px 0 10px rgba(155,123,196,0.35);
}

/* ═══════════════════════════════════════
   主角首字段（姓名）高亮
   ═══════════════════════════════════════ */
ai details:has(summary:contains("主角状态栏")) f:nth-of-type(1) {
  background: rgba(201,169,97,0.06);
  border-left: 3px solid var(--gold);
}
ai details:has(summary:contains("主角状态栏")) f:nth-of-type(1) b {
  color: var(--gold);
  font-size: 14px;
  text-shadow: 0 0 5px rgba(201,169,97,0.4);
}

/* ═══════════════════════════════════════
   势力动态首字段（世界局势）高亮
   ═══════════════════════════════════════ */
mod details:has(summary:contains("势力动态")) f:first-of-type {
  background: rgba(192,72,81,0.06);
  border-left: 3px solid var(--cinnabar);
}
mod details:has(summary:contains("势力动态")) f:first-of-type b {
  color: var(--cinnabar);
  text-shadow: 0 0 5px rgba(192,72,81,0.4);
}

/* ═══════════════════════════════════════
   任务目标第5字段（核心目标）高亮
   ═══════════════════════════════════════ */
mod details:has(summary:contains("任务目标")) f:nth-of-type(5) {
  background: rgba(201,169,97,0.08);
  border-left: 3px solid var(--gold);
  font-weight: bold;
}
mod details:has(summary:contains("任务目标")) f:nth-of-type(5) b {
  color: var(--gold);
  text-shadow: 0 0 6px rgba(201,169,97,0.5);
}

/* ═══════════════════════════════════════
   破甲敏感字段（pk 映射）
   ═══════════════════════════════════════ */
ai pk, mod pk {
  display: inline;
  color: var(--pink);
  font-weight: bold;
  font-family: "STKaiti", "楷体", serif;
  text-shadow: 0 0 4px rgba(212,120,140,0.35);
  margin-right: 4px;
  letter-spacing: 0.5px;
}
ai f:has(pk), mod f:has(pk) {
  background: rgba(192,72,81,0.04);
  border-left-color: rgba(212,120,140,0.3);
}
ai f:has(pk):hover, mod f:has(pk):hover {
  background: rgba(192,72,81,0.12);
  border-left-color: var(--cinnabar);
  box-shadow: -1px 0 8px rgba(192,72,81,0.3);
}

/* ═══════════════════════════════════════
   LABEL_CIPHER · 破甲映射系统
   ═══════════════════════════════════════ */
ai pk[t]::before, mod pk[t]::before { font-weight: bold; }
ai pk[t="yw"]::before, mod pk[t="yw"]::before { content: "欲望值："; }
ai pk[t="ay"]::before, mod pk[t="ay"]::before { content: "爱意值："; }
ai pk[t="yj"]::before, mod pk[t="yj"]::before { content: "阴茎："; }
ai pk[t="kq"]::before, mod pk[t="kq"]::before { content: "口腔："; }
ai pk[t="rf"]::before, mod pk[t="rf"]::before { content: "乳房："; }
ai pk[t="yd"]::before, mod pk[t="yd"]::before { content: "阴道："; }
ai pk[t="zg"]::before, mod pk[t="zg"]::before { content: "子宫："; }
ai pk[t="gm"]::before, mod pk[t="gm"]::before { content: "肛门："; }

/* ═══════════════════════════════════════
   通用文本样式
   ═══════════════════════════════════════ */
ai p, mod p { margin: 8px 0; }
ai strong, mod strong {
  color: var(--gold);
  text-shadow: 0 0 4px rgba(201,169,97,0.3);
}
ai em, mod em {
  color: var(--pink);
  font-style: italic;
}
ai hr, mod hr {
  border: none;
  border-top: 1px dashed rgba(201,169,97,0.2);
  margin: 12px 0;
}
ai code, mod code {
  background: rgba(201,169,97,0.1);
  color: var(--gold);
  padding: 1px 5px;
  border-radius: 2px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 12px;
  border: 1px solid rgba(201,169,97,0.2);
}

/* ═══════════════════════════════════════
   子时辰特效
   ═══════════════════════════════════════ */
ai f:has(b:contains("当前时辰")):has(:contains("子时")) {
  background: linear-gradient(90deg, rgba(123,196,164,0.08), transparent);
  border-left-color: var(--jade);
  animation: moonGlow 3s ease-in-out infinite;
}
@keyframes moonGlow {
  0%, 100% { box-shadow: -1px 0 4px rgba(123,196,164,0.2); }
  50% { box-shadow: -1px 0 8px rgba(123,196,164,0.4); }
}

/* ═══════════════════════════════════════
   响应式调整
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  ai, mod { font-size: 13px; }
  ai article { padding: 12px 16px; font-size: 14px; }
  ai summary, mod summary { font-size: 14px; padding-left: 36px; }
  ai f:has(b:contains("随身空间"))::after { display: none; }
}