/* ===== 璀璨星辉 - 角色状态监控终端美化 ===== */

/* ---------- 设计令牌（CSS变量） ---------- */
:root {
  --bg-primary: #0a0a0f;
  --surface-dark: #111118;
  --surface-content: #0d0d15;
  --border-evil: #2a1a2a;
  --border-active: #8b1a4a;
  --border-subtle: #1a1a2a;
  --border-memory: #1a2a3a;
  --accent-blood: #c41e3a;
  --accent-void: #6b0f8a;
  --accent-neon: #e040fb;
  --accent-decay: #8d6e63;
  --accent-memory: #1565c0;
  --text-primary: #c8c8d0;
  --text-body: #c0b8c0;
  --text-title: #e8d0d8;
  --text-highlight: #ffd0d8;
  --text-warning: #e8a0a8;
  --text-info: #c0a0d0;
  --text-accent: #d8b0e8;
  --text-muted: #8a7a80;
  --text-memory: #8098b0;
  --text-opening: #d8c8d0;
  --text-emphasis: #e8a0b0;
  --text-whisper: #a080b0;
  --font-display: "PingFang SC", "HarmonyOS Sans", sans-serif;
  --font-body: "PingFang SC", "Noto Serif SC", serif;
  --font-mono: "SF Mono", "Fira Code", monospace;
  --font-xs: 13px;
  --font-sm: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --transition-fast: 0.15s;
  --transition-base: 0.25s;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 基础重置 ---------- */
details {
  background-color: var(--surface-dark);
  border: 1px solid var(--border-evil);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  padding: var(--space-md);
  box-shadow: 0 0 20px rgba(180, 0, 60, 0.08), inset 0 0 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base) var(--ease-out);
  color: var(--text-primary);
}

/* 左侧血腥渐变条 */
details::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-blood) 0%, var(--accent-void) 50%, var(--accent-blood) 100%);
  opacity: 0.7;
  z-index: 1;
}

details:hover {
  border-color: var(--border-active);
  box-shadow: 0 0 30px rgba(200, 30, 60, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.6);
}

/* ---------- 折叠面板标题 ---------- */
summary {
  font-weight: bold;
  color: var(--text-title);
  cursor: pointer;
  text-shadow: 0 0 5px rgba(255, 51, 102, 0.5);
  outline: none;
  font-family: var(--font-display);
  font-size: var(--font-lg);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(180, 0, 60, 0.1) 0%, rgba(100, 0, 80, 0.1) 100%);
  border-left: 3px solid var(--accent-blood);
  transition: all var(--transition-fast) var(--ease-out);
  position: relative;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

/* 折叠箭头 */
summary::after {
  content: "▼";
  position: absolute;
  right: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-xs);
  color: var(--text-muted);
  transition: transform var(--transition-fast) var(--ease-out);
}

details[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

summary:hover {
  background: linear-gradient(135deg, rgba(220, 30, 70, 0.2) 0%, rgba(120, 0, 90, 0.2) 100%);
  color: var(--text-highlight);
}

/* ---------- 面板内段落（状态数据） ---------- */
details p {
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  line-height: 1.7;
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-xs) 0;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast) var(--ease-out);
  color: var(--text-body);
}

/* ---------- 状态指标色条（按段落顺序） ---------- */
details p:nth-of-type(1) {
  border-left-color: var(--accent-blood);
  color: var(--text-warning);
}

details p:nth-of-type(2) {
  border-left-color: var(--accent-void);
  color: var(--text-info);
}

details p:nth-of-type(3) {
  border-left-color: var(--accent-neon);
  color: var(--text-accent);
}

details p:nth-of-type(4) {
  border-left-color: var(--accent-decay);
  color: var(--text-muted);
}

details p:nth-of-type(5) {
  border-left-color: var(--accent-blood);
  color: var(--text-warning);
}

details p:nth-of-type(6) {
  border-left-color: var(--accent-void);
  color: var(--text-info);
}

details p:nth-of-type(7) {
  border-left-color: var(--accent-neon);
  color: var(--text-accent);
}

/* 状态标签高亮 */
details p strong,
details p b {
  color: var(--text-highlight);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 100, 140, 0.3);
}

/* ---------- 记忆区独立配色（第二个 details） ---------- */
details + details {
  border-color: var(--border-memory);
  box-shadow: 0 0 20px rgba(0, 100, 200, 0.06), inset 0 0 30px rgba(0, 0, 0, 0.6);
}

details + details::before {
  background: linear-gradient(180deg, var(--accent-memory) 0%, var(--accent-void) 50%, var(--accent-memory) 100%);
}

details + details summary {
  background: linear-gradient(135deg, rgba(20, 80, 160, 0.1) 0%, rgba(40, 20, 80, 0.1) 100%);
  border-left-color: var(--accent-memory);
  color: var(--text-info);
}

details + details summary:hover {
  background: linear-gradient(135deg, rgba(30, 100, 200, 0.2) 0%, rgba(60, 30, 100, 0.2) 100%);
  color: var(--text-highlight);
}

details + details p {
  font-size: var(--font-xs);
  color: var(--text-memory);
  border-bottom: 1px solid rgba(20, 80, 160, 0.15);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.3);
}

details + details p:last-of-type {
  border-bottom: none;
}

/* ---------- 正文内容区（details 之后紧跟的 div） ---------- */
details + div {
  background: var(--surface-content);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-md);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--font-md);
  line-height: 1.9;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.4);
  position: relative;
  letter-spacing: 0.02em;
}

details + div::first-line {
  font-size: var(--font-lg);
  color: var(--text-opening);
  font-weight: 500;
}

details + div strong,
details + div b {
  color: var(--text-emphasis);
  font-weight: 700;
}

details + div em,
details + div i {
  color: var(--text-whisper);
  font-style: italic;
  opacity: 0.85;
}

/* ---------- 全局细节 ---------- */
::selection {
  background: rgba(180, 0, 60, 0.4);
  color: var(--text-highlight);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border-evil);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blood);
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 768px) {
  summary {
    font-size: var(--font-md);
    padding: var(--space-sm);
  }

  details p {
    font-size: var(--font-xs);
  }

  details + div {
    padding: var(--space-md);
    font-size: var(--font-sm);
  }
}

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  details,
  summary,
  details p {
    transition: none;
  }
}