/* 混沌猫·深层终端UI样式注入 (Catnip-Core CSS Patch) — 深色适配版 */
/* 适配 <hd>, <details>, <summary>, <log>, <card>, <section>, <f>, <d> 等自定标签 */

:root {
  --cat-primary: #4d8cff;          /* 明亮蓝 */
  --cat-female: #ff69b4;           /* 粉红，适合深色 */
  --cat-male: #e67e22;             /* 橙黄，调亮 */
  --cat-bg: #0f0f1a;              /* 主背景深色 */
  --cat-card-bg: #1e1e2f;         /* 卡片/面板背景 */
  --cat-border: #3a3a5a;          /* 边框 */
  --cat-text-main: #e2e8f0;       /* 主要文字 */
  --cat-text-muted: #a0aec0;      /* 次要文字 */
  --cat-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --cat-radius: 10px;
}

/* 头部信息条 */
hd {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  background: var(--cat-card-bg);
  padding: 14px 18px;
  border-radius: var(--cat-radius);
  margin-bottom: 20px;
  border-left: 5px solid var(--cat-primary);
  box-shadow: var(--cat-shadow);
  font-family: system-ui, -apple-system, sans-serif;
}
hd d {
  color: var(--cat-text-main);
  font-size: 0.95em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 折叠面板通用 */
details {
  background: var(--cat-card-bg);
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
}
details:hover {
  box-shadow: var(--cat-shadow);
}
summary {
  background: #2a2a40;             /* 比卡片稍亮 */
  padding: 12px 18px;
  font-weight: 700;
  color: var(--cat-text-main);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  user-select: none;
  display: flex;
  align-items: center;
  font-size: 1.05em;
}
details[open] summary {
  border-bottom: 1px solid var(--cat-border);
  background: #2d2d44;
}

/* 记忆档案区 */
log {
  display: block;
  padding: 16px;
  background: #161625;
  font-size: 0.9em;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}
item {
  display: block;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--cat-border);
  color: #cbd5e0;
}
item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
item b {
  color: var(--cat-primary);
  font-family: monospace;
}

/* 角色与状态卡片 */
card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 16px;
  background: var(--cat-bg);
}
card[type="pc"] section { border-left-color: var(--cat-primary); }
card[type="npc"] section { border-left-color: var(--cat-female); }

section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--cat-card-bg);
  border-radius: 8px;
  border-left: 4px solid var(--cat-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
section::before {
  content: attr(t);
  font-size: 0.75em;
  color: var(--cat-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  font-weight: bold;
}
f {
  display: block;
  font-size: 1.15em;
  color: var(--cat-text-main);
  border-bottom: 2px solid var(--cat-border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
card d {
  display: block;
  font-size: 0.9em;
  color: #cbd5e0;
  line-height: 1.6;
}
card d b {
  color: var(--cat-text-main);
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  padding: 2px 4px;
  border-radius: 4px;
}
card d i {
  color: var(--cat-text-muted);
  font-style: italic;
  border-left: 2px solid var(--cat-border);
  padding-left: 6px;
}

/* 滚动条美化（深色适配） */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4a4a6a; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #6a6a8a; }