/* =========================================================
   CRIMSON SYNDICATE TERMINAL - YANDERE BOSS THEME
   ========================================================= */

/* --- 1. 全局核心变量 (Core Variables) --- */
:root {
  /* 色彩系统 */
  --bg-void: #050507; /* 深渊黑 */
  --panel-base: rgba(15, 12, 14, 0.85); /* 终端面板底色 */
  
  --crimson-blood: #d91818; /* 核心警告/暴力色 */
  --crimson-dark: #7a0d0d;
  --gold-corrupt: #b89947; /* 家族暗金/财富象征 */
  --pink-obsess: #ff3366; /* 病娇/恋人专属色 */
  
  --text-main: #d1d4dc; /* 主文本 */
  --text-muted: #6b6e7a; /* 次要文本 */
  
  /* 发光特效 */
  --glow-blood: 0 0 10px rgba(217, 24, 24, 0.3);
  --glow-gold: 0 0 12px rgba(184, 153, 71, 0.2);
  --glow-obsess: 0 0 15px rgba(255, 51, 102, 0.4);

  /* 字体系统 */
  --font-sys: 'Courier New', Consolas, monospace; /* 数据/终端字体 */
  --font-serif: 'Playfair Display', 'Georgia', serif; /* 优雅/教父字体 */
}

/* 基础重置与背景 */
body {
  background-color: var(--bg-void);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(122, 13, 13, 0.1) 0%, transparent 60%),
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 4px;
}

/* --- 2. 状态栏折叠面板 (HUD Details Panels) --- */
details {
  background: var(--panel-base);
  border: 1px solid rgba(184, 153, 71, 0.15);
  border-left: 3px solid var(--gold-corrupt);
  border-radius: 2px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 针对恋人和敌对势力的特殊边框 */
details:has(.section-lover) { border-left-color: var(--pink-obsess); }
details:has(.section-rivals) { border-left-color: var(--crimson-blood); }

/* 折叠标题 (Summary) */
summary {
  background: linear-gradient(90deg, rgba(184, 153, 71, 0.08) 0%, transparent 100%);
  color: var(--gold-corrupt);
  font-family: var(--font-sys);
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 10px 15px;
  cursor: pointer;
  list-style: none; /* 隐藏原生箭头 */
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

summary::-webkit-details-marker { display: none; }
summary::before {
  content: '[ LOCKED ]';
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-right: 10px;
  transition: 0.3s;
}
details[open] summary::before {
  content: '[ ACCESS ]';
  color: var(--crimson-blood);
  text-shadow: var(--glow-blood);
}

details[open] summary {
  border-bottom: 1px solid rgba(184, 153, 71, 0.2);
  margin-bottom: 10px;
}

/* Markdown 内容渲染美化 */
details p, details ul, details li {
  padding: 0 15px;
  line-height: 1.6;
  font-size: 0.9rem;
}
details strong {
  color: var(--gold-corrupt);
  font-family: var(--font-serif);
  font-weight: normal;
  font-size: 1rem;
}
details hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 153, 71, 0.3), transparent);
  margin: 15px 0;
}

/* --- 3. 专属模块定制 (Custom HTML Sections) --- */

/* VIP资产监控 (Lover Section) - 病娇监控台 */
.section-lover {
  padding: 10px 15px;
  background: radial-gradient(ellipse at center, rgba(255, 51, 102, 0.05) 0%, transparent 70%);
  border: 1px dashed rgba(255, 51, 102, 0.2);
  margin: 0 15px 15px 15px;
}

.lover-metrics {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.lover-data-node { text-align: center; flex: 1; }
.lover-data-label { font-family: var(--font-sys); font-size: 0.7rem; color: var(--text-muted); }
.lover-data-value { 
  font-family: var(--font-sys); 
  font-size: 1.2rem; 
  color: var(--pink-obsess); 
  text-shadow: var(--glow-obsess); 
  font-weight: bold;
}

/* 恋人心电图特效 */
.lover-heartbeat {
  height: 25px;
  width: 100%;
  background: repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(255, 51, 102, 0.1) 20px, rgba(255, 51, 102, 0.1) 21px),
              repeating-linear-gradient(0deg, transparent, transparent 10px, rgba(255, 51, 102, 0.1) 10px, rgba(255, 51, 102, 0.1) 11px);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 51, 102, 0.2);
}
.lover-heartbeat::after {
  content: '';
  position: absolute;
  top: 50%; left: -10%;
  width: 5px; height: 5px;
  background: var(--pink-obsess);
  border-radius: 50%;
  box-shadow: 0 0 10px 4px var(--pink-obsess);
  animation: ecg-scan 2s infinite linear;
}
@keyframes ecg-scan {
  0% { left: -10%; transform: translateY(0); }
  20% { transform: translateY(0); }
  25% { transform: translateY(-10px); }
  30% { transform: translateY(10px); }
  35% { transform: translateY(0); }
  100% { left: 110%; transform: translateY(0); }
}

/* 家族势力 (Famiglia Section) */
.section-famiglia { padding: 0 15px; }
.subordinate-list { list-style: none; padding: 0; }
.sub-status-bar {
  width: 150px; height: 4px;
  background: #1a1a1a;
  border: 1px solid #333;
  margin-top: 5px; margin-bottom: 15px;
}
.sub-status-fill {
  height: 100%;
  background: var(--gold-corrupt);
  box-shadow: var(--glow-gold);
}
.sub-status-fill.risk {
  background: var(--crimson-blood);
  box-shadow: var(--glow-blood);
}

/* 敌对势力 (Rivals Section) */
.section-rivals { padding: 0 15px; }
.target-status {
  background: rgba(217, 24, 24, 0.15);
  color: var(--crimson-blood);
  padding: 2px 6px;
  border: 1px solid var(--crimson-blood);
  font-family: var(--font-sys);
  font-size: 0.75rem;
  animation: pulse-alert 2s infinite;
}
@keyframes pulse-alert {
  0%, 100% { box-shadow: 0 0 0 transparent; }
  50% { box-shadow: 0 0 8px rgba(217, 24, 24, 0.6); }
}
.turf-war-bar {
  width: 100%; height: 8px;
  background: rgba(217, 24, 24, 0.3); /* 敌方地盘 */
  border: 1px solid rgba(255,255,255,0.1);
  margin-top: 5px;
}
.turf-owned {
  height: 100%;
  background: var(--gold-corrupt); /* 我方地盘 */
  box-shadow: var(--glow-gold);
}

/* 记忆区表格美化 */
table {
  width: calc(100% - 30px);
  margin: 10px 15px;
  border-collapse: collapse;
  font-family: var(--font-sys);
  font-size: 0.8rem;
}
th {
  background: rgba(184, 153, 71, 0.1);
  color: var(--gold-corrupt);
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--gold-corrupt);
}
td {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
}

/* =========================================================
   CHAT BOX BEAUTIFICATION (加密通讯信道)
   ========================================================= */

/* 聊天气泡行容器 */
.msg-row {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease-out forwards;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 基础气泡样式 */
.msg-bubble {
  max-width: 85%;
  padding: 15px 20px;
  border-radius: 4px;
  line-height: 1.6;
  position: relative;
  font-size: 1rem;
}

/* --- 头目/AI 回复 (Boss Response) --- */
.msg-row.ai-boss { justify-content: flex-start; }
.msg-row.ai-boss .msg-bubble {
  background: linear-gradient(135deg, rgba(20, 10, 10, 0.95) 0%, rgba(10, 5, 5, 0.98) 100%);
  border: 1px solid rgba(217, 24, 24, 0.2);
  border-left: 4px solid var(--crimson-blood);
  color: #e5e5e5;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
}
/* 装饰角 */
.msg-row.ai-boss .msg-bubble::before {
  content: 'AUTHORIZATION: DON';
  position: absolute;
  top: -20px; left: 0;
  font-family: var(--font-sys);
  font-size: 0.65rem;
  color: var(--crimson-blood);
  letter-spacing: 1px;
}

/* --- 玩家/下属 回复 (User Input) --- */
.msg-row.user-sub { justify-content: flex-end; }
.msg-row.user-sub .msg-bubble {
  background: rgba(25, 25, 30, 0.85);
  border: 1px solid rgba(184, 153, 71, 0.2);
  border-right: 4px solid var(--gold-corrupt);
  color: var(--text-muted);
}

/* --- 文本高亮特效 (用于AI输出时的强调) --- */
/* 病娇/占有欲描写高亮 */
.obsess-text {
  color: var(--pink-obsess);
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
  background: rgba(255, 51, 102, 0.1);
  padding: 0 4px;
  border-radius: 2px;
}

/* 暴力/血腥/威胁描写高亮 */
.threat-text {
  color: var(--crimson-blood);
  font-family: var(--font-sys);
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.3);
  text-shadow: 2px 0 0 rgba(217, 24, 24, 0.5);
}