/* ═══════════════════════════════════════════════════════════════
   修仙风格·浅金色代码块美化方案
   配色灵感：金阙玉宇、仙府琼楼、晨曦霞光
   ═══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────── */
/* === 思维链检查 ===
1. 容器选择器：基于<c-ui>，避免全局污染 ✓
2. 禁用选择器：无*{}/:root/body{}/html{} ✓
3. 配色体系：浅金#f4d7a6、深金#d4a574、墨绿#2d4a3e、朱砂#c24d4d ✓
4. 移动端优先：14px字体/紧凑间距/单列流式 ✓
5. 装饰手段：云纹SVG背景/渐变光晕/伪元素边框/hover动效 ✓
6. 信息完整性：所有字段保留，无省略 ✓
=== 开始生成 === */

c-ui {
  --gold-light: #f4d7a6;
  --gold-dark: #d4a574;
  --ink: #2d4a3e;
  --cinnabar: #c24d4d;
  --jade: #e8f5e9;
  display: block;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(135deg, #fdfbf7 0%, var(--gold-light) 100%);
  padding: 12px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.15);
}

/* 云纹装饰背景 */
c-ui::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80'%3E%3Cpath d='M0 40Q50 20 100 40T200 40T300 40T400 40' fill='none' stroke='%23d4a574' stroke-width='0.5' opacity='0.3'/%3E%3Cpath d='M0 50Q50 30 100 50T200 50T300 50T400 50' fill='none' stroke='%23d4a574' stroke-width='0.5' opacity='0.2'/%3E%3C/svg%3E") repeat-x;
  pointer-events: none;
  opacity: 0.6;
}

/* 头部信息区 */
c-ui hd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

c-ui hd::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

c-ui hd t,
c-ui hd l {
  display: inline-block;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

/* 状态行 */
c-ui > l {
  display: block;
  padding: 4px 8px;
  margin: 4px 0;
  background: rgba(232, 245, 233, 0.4);
  border-left: 3px solid var(--gold-dark);
  border-radius: 3px;
  font-size: 13px;
}

/* 正文区域 */
c-ui txt {
  display: block;
  padding: 10px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  border: 1px solid rgba(212, 165, 116, 0.3);
  line-height: 1.8;
  text-align: justify;
}

/* Details 容器通用样式 */
c-ui details {
  margin: 8px 0;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

c-ui details summary {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
}

c-ui details summary::marker {
  content: '';
}

c-ui details summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.25s ease;
  font-size: 10px;
}

c-ui details[open] summary::before {
  transform: rotate(90deg);
}

c-ui details summary:hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 6px rgba(45, 74, 62, 0.15);
}

/* 系统协议区 */
c-ui details.sys summary {
  background: linear-gradient(135deg, var(--ink) 0%, #1a2e26 100%);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
}

/* 玩家状态区 */
c-ui details.u summary {
  background: linear-gradient(135deg, #5a7d6f 0%, var(--ink) 100%);
  color: var(--jade);
  border-bottom: 2px solid var(--gold-dark);
}

/* 角色状态区 */
c-ui details.c summary {
  background: linear-gradient(135deg, var(--cinnabar) 0%, #a83e3e 100%);
  color: #fff;
  border-bottom: 2px solid var(--gold-dark);
}

/* 周围人物区 */
c-ui details.w summary {
  background: linear-gradient(135deg, #8b7355 0%, #6d5a47 100%);
  color: #fff;
  border-bottom: 2px solid var(--gold-dark);
}

/* 警戒情况区 */
c-ui details.d summary {
  background: linear-gradient(135deg, #c24d4d 0%, #992d2d 100%);
  color: #fff;
  border-bottom: 2px solid var(--gold-dark);
}

/* 记忆笔记区 */
c-ui details.m summary {
  background: linear-gradient(135deg, var(--gold-dark) 0%, #b8935f 100%);
  color: var(--ink);
  border-bottom: 2px solid var(--gold-dark);
}

/* 选项区 */
c-ui details.o summary {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-dark) 100%);
  color: var(--ink);
  border-bottom: 2px solid var(--cinnabar);
  box-shadow: 0 2px 8px rgba(194, 77, 77, 0.3);
}

/* Details 内容区 */
c-ui details p {
  margin: 0;
  padding: 8px 10px;
  background: rgba(253, 251, 247, 0.9);
}

c-ui details[open] p {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 数据行布局 */
c-ui d {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(212, 165, 116, 0.25);
  align-items: start;
}

c-ui d:last-child {
  border-bottom: none;
}

/* 字段名 */
c-ui f {
  display: inline-block;
  font-weight: 600;
  color: var(--gold-dark);
  min-width: 70px;
  font-size: 13px;
  position: relative;
  padding-left: 12px;
}

c-ui f::before {
  content: '◆';
  position: absolute;
  left: 0;
  color: var(--cinnabar);
  font-size: 10px;
}

/* 字段值 */
c-ui d span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

/* 记忆规则区 */
c-ui mr {
  display: block;
  padding: 8px;
  background: rgba(232, 245, 233, 0.5);
  border-left: 3px solid var(--gold-dark);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 6px;
  border-radius: 3px;
}

c-ui mr b {
  color: var(--cinnabar);
  font-weight: 600;
}

/* 嵌套details（短期记忆/历史档案） */
c-ui details.sm {
  margin: 6px 0 0 0;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(212, 165, 116, 0.3);
}

c-ui details.sm summary {
  background: linear-gradient(90deg, var(--jade), rgba(232, 245, 233, 0.3));
  color: var(--ink);
  font-size: 13px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

c-ui details.sm p {
  padding: 6px 10px;
  font-size: 12px;
  background: #fff;
  line-height: 1.7;
}

/* 选项按钮 */
c-ui details.o p {
  margin: 4px 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff 0%, var(--jade) 100%);
  border: 2px solid var(--gold-dark);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

c-ui details.o p::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.3) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
  border-radius: 50%;
}

c-ui details.o p:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
  border-color: var(--cinnabar);
  background: linear-gradient(135deg, var(--gold-light) 0%, #fff 100%);
}

c-ui details.o p:hover::before {
  width: 300px;
  height: 300px;
}

c-ui details.o p:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(212, 165, 116, 0.3);
}

/* 移动端优化 */
@media (max-width: 768px) {
  c-ui {
    font-size: 13px;
    padding: 8px;
  }
  
  c-ui hd t,
  c-ui hd l {
    font-size: 12px;
  }
  
  c-ui details summary {
    font-size: 13px;
    padding: 7px 10px;
  }
  
  c-ui f {
    min-width: 60px;
    font-size: 12px;
  }
  
  c-ui d span {
    font-size: 12px;
  }
}