ai {
  display: block;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  background: linear-gradient(165deg, #FFF8F0 0%, #FFF0E6 40%, #FFE8E0 100%);
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(255, 140, 66, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  color: #3D2B1F;
  line-height: 1.6;
  position: relative;
  overflow: hidden;
}

/* 夏日光影装饰 */
ai::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.20) 0%, rgba(255, 140, 66, 0.08) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

ai::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 107, 138, 0.10) 0%, rgba(255, 107, 107, 0.05) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ===== 头部 ===== */
hd {
  display: block;
  text-align: center;
  padding: 14px 20px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #FF9A56 0%, #FF6B6B 50%, #FF6B8A 100%);
  border-radius: 18px;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

/* ===== 正文 ===== */
article {
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 215, 0, 0.20);
  box-shadow: 0 2px 12px rgba(255, 140, 66, 0.08);
  position: relative;
  z-index: 1;
}

article p {
  margin: 0 0 10px;
  font-size: 15px;
  color: #4A3728;
}
article p:last-child { margin-bottom: 0; }

/* ===== 通用折叠面板 ===== */
details {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: 0 2px 12px rgba(255, 140, 66, 0.06);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

details:hover {
  box-shadow: 0 4px 24px rgba(255, 140, 66, 0.12);
}

details[open] {
  box-shadow: 0 4px 28px rgba(255, 140, 66, 0.10);
}

summary {
  padding: 13px 18px;
  font-weight: 600;
  font-size: 15px;
  color: #3D2B1F;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(255, 248, 240, 0.90) 0%, rgba(255, 240, 230, 0.60) 100%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.10);
  user-select: none;
  transition: background 0.25s ease;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: "▸";
  font-size: 14px;
  color: #FF8C42;
  transition: transform 0.3s ease;
  display: inline-block;
}

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

details[open] > summary {
  background: linear-gradient(90deg, rgba(255, 248, 240, 1) 0%, rgba(255, 235, 220, 0.80) 100%);
  border-bottom: 1px solid rgba(255, 215, 0, 0.20);
}

/* ===== 角色信息区 ===== */
details.info {
  border-left: 3px solid #FFD700;
}

details.info > summary {
  color: #8B6F3A;
}

details.info p {
  padding: 14px 18px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 14px;
  margin: 0;
}

details.info f {
  font-weight: 600;
  color: #8B6F3A;
  white-space: nowrap;
  min-width: 48px;
}

details.info f::after {
  content: "：";
  color: #C4A66A;
}

details.info d {
  color: #5A4030;
}

/* ===== NPC状态区 — 核心夏日色情主题 ===== */
details.npc {
  border-left: 3px solid #FF6B8A;
  background: linear-gradient(135deg, rgba(255, 248, 245, 0.85) 0%, rgba(255, 235, 235, 0.70) 100%);
}

details.npc > summary {
  color: #C44A6A;
  background: linear-gradient(90deg, rgba(255, 240, 240, 0.95) 0%, rgba(255, 220, 225, 0.70) 100%);
}

details.npc > summary::after {
  content: "💗";
  margin-left: auto;
  font-size: 16px;
  animation: npcPulse 2.5s ease-in-out infinite;
}

@keyframes npcPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* NPC 基础信息 */
details.npc > p:first-of-type {
  padding: 14px 18px 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 14px;
  margin: 0;
  background: rgba(255, 230, 230, 0.20);
}

details.npc > p:first-of-type f {
  font-weight: 600;
  color: #B84A6A;
  min-width: 44px;
}

details.npc > p:first-of-type f::after {
  content: "：";
  color: #D48A9A;
}

details.npc > p:first-of-type d {
  color: #5A3840;
}

/* 分类标题 c */
c {
  display: block;
  padding: 10px 18px 6px;
  font-weight: 600;
  font-size: 14px;
  color: #6A4A4A;
  letter-spacing: 0.4px;
  background: linear-gradient(90deg, rgba(255, 220, 220, 0.20) 0%, transparent 80%);
}

c.sen {
  color: #C44060;
  background: linear-gradient(90deg, rgba(255, 200, 210, 0.30) 0%, transparent 80%);
}

c.sen::before {
  content: "💕 ";
  font-size: 13px;
}

/* 数值状态 */
p.stats {
  padding: 6px 18px 12px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

p.stats l {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #4A3838;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 180, 180, 0.15);
}

p.stats l:last-child { border-bottom: none; }

p.stats l::before {
  content: "·";
  color: #FF8A8A;
  font-weight: bold;
  font-size: 16px;
}

/* 数值标签 v — 进度条核心 */
v {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* data-lv 映射 — 从清新到色情 */
v[data-lv="1"] {
  background: linear-gradient(90deg, #7EC8A0, #9DD4B0);
  width: 20%;
  min-width: 44px;
  box-shadow: 0 1px 6px rgba(126, 200, 160, 0.20);
}
v[data-lv="2"] {
  background: linear-gradient(90deg, #B8D98A, #D4E8A0);
  width: 40%;
  min-width: 44px;
  box-shadow: 0 1px 8px rgba(180, 210, 120, 0.20);
}
v[data-lv="3"] {
  background: linear-gradient(90deg, #FFD93D, #FFE066);
  width: 60%;
  min-width: 44px;
  color: #5A4020;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.30);
  box-shadow: 0 1px 10px rgba(255, 217, 61, 0.25);
}
v[data-lv="4"] {
  background: linear-gradient(90deg, #FF8C42, #FFA666);
  width: 80%;
  min-width: 44px;
  box-shadow: 0 2px 14px rgba(255, 140, 66, 0.30);
}
v[data-lv="5"] {
  background: linear-gradient(90deg, #FF4D6D, #FF6B8A, #FF8A9E);
  width: 100%;
  min-width: 44px;
  box-shadow: 0 2px 20px rgba(255, 77, 109, 0.35), 0 0 30px rgba(255, 77, 109, 0.15);
  animation: heatGlow 1.8s ease-in-out infinite;
}

@keyframes heatGlow {
  0%, 100% { box-shadow: 0 2px 20px rgba(255, 77, 109, 0.35), 0 0 30px rgba(255, 77, 109, 0.15); }
  50% { box-shadow: 0 2px 28px rgba(255, 77, 109, 0.50), 0 0 50px rgba(255, 77, 109, 0.25); }
}

/* data-inv 反转 — 欲望值越高越色情 */
v[data-inv="true"][data-lv="1"] {
  background: linear-gradient(90deg, #FF8A9E, #FF6B8A);
  box-shadow: 0 2px 16px rgba(255, 107, 138, 0.25);
  animation: heatGlow 1.8s ease-in-out infinite;
}
v[data-inv="true"][data-lv="2"] {
  background: linear-gradient(90deg, #FFA666, #FF8C42);
  box-shadow: 0 2px 14px rgba(255, 140, 66, 0.20);
}
v[data-inv="true"][data-lv="3"] {
  background: linear-gradient(90deg, #FFE066, #FFD93D);
  color: #5A4020;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.30);
  box-shadow: 0 1px 10px rgba(255, 217, 61, 0.20);
}
v[data-inv="true"][data-lv="4"] {
  background: linear-gradient(90deg, #D4E8A0, #B8D98A);
  box-shadow: 0 1px 8px rgba(180, 210, 120, 0.20);
}
v[data-inv="true"][data-lv="5"] {
  background: linear-gradient(90deg, #9DD4B0, #7EC8A0);
  box-shadow: 0 1px 6px rgba(126, 200, 160, 0.20);
}

/* 数值右侧范围 */
span.r {
  font-size: 11px;
  color: #B08A8A;
  margin-left: 2px;
  font-weight: 400;
}

/* 数值描述行 */
l.sd {
  font-size: 12.5px;
  color: #8A6A6A;
  padding-left: 18px !important;
  font-style: italic;
  border-bottom: none !important;
  margin-top: -2px;
  margin-bottom: 2px;
}

l.sd::before {
  content: "↳ " !important;
  color: #C4A0A0 !important;
  font-size: 12px !important;
}

/* 生理状态 */
p.phys {
  padding: 6px 18px 12px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  background: rgba(255, 225, 230, 0.15);
  border-radius: 0 0 12px 12px;
}

p.phys l {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13.5px;
  color: #4A3838;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 180, 180, 0.10);
}

p.phys l:last-child { border-bottom: none; }

p.phys l::before {
  content: "•";
  color: #FF8A8A;
  font-weight: bold;
  font-size: 16px;
  line-height: 1.4;
}

p.phys d {
  color: #5A4040;
  font-size: 13px;
}

d.psy {
  color: #A06070 !important;
  font-style: italic;
  background: rgba(255, 200, 210, 0.15);
  padding: 1px 8px;
  border-radius: 8px;
  display: inline-block;
}

d.sh {
  color: #B84860 !important;
  font-weight: 600;
}

/* 身体细节与开发度 */
p.bd {
  padding: 6px 18px 12px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 13.5px;
  background: rgba(255, 220, 225, 0.08);
  border-radius: 0 0 12px 12px;
}

p.bd f {
  font-weight: 600;
  color: #B84A6A;
  font-size: 13px;
  display: inline;
}

p.bd f::after {
  content: "：";
  color: #D48A9A;
}

p.bd d {
  color: #5A4040;
  font-size: 13px;
  display: inline;
}

d.dev {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  font-size: 12px !important;
  color: #8A5A6A !important;
  margin-left: 4px;
}

d.dev d.sh {
  font-size: 12px;
  padding: 0 4px;
}

/* 身体开发度进度条特殊处理 */
p.bd l {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #4A3838;
  padding: 4px 0;
  border-top: 1px dashed rgba(255, 180, 180, 0.15);
  margin-top: 4px;
}

p.bd l::before {
  content: "◆";
  color: #FF8A8A;
  font-size: 10px;
}

/* 记录区 */
p.rec {
  padding: 6px 18px 12px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13.5px;
  background: rgba(255, 225, 230, 0.08);
  border-radius: 0 0 12px 12px;
}

p.rec l {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4A3838;
  font-size: 13px;
}

p.rec l::before {
  content: "💧";
  font-size: 11px;
}

/* 其他区域 */
details.npc > p:last-of-type {
  padding: 6px 18px 14px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  font-size: 13.5px;
}

details.npc > p:last-of-type l {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4A3838;
  padding: 3px 0;
}

details.npc > p:last-of-type l::before {
  content: "·";
  color: #FF8A8A;
  font-weight: bold;
}

details.npc > p:last-of-type f {
  font-weight: 600;
  color: #8A5A5A;
  min-width: 40px;
}

/* ===== 记忆区 ===== */
details.mem {
  border-left: 3px solid #7EC8A0;
}

details.mem > summary {
  color: #4A8A6A;
}

details.mem c {
  color: #4A7A5A;
  background: linear-gradient(90deg, rgba(180, 230, 200, 0.15) 0%, transparent 80%);
  font-size: 13px;
  padding: 8px 18px 4px;
}

details.mem p {
  padding: 6px 18px 12px;
  margin: 0;
  font-size: 13px;
  color: #4A5A4A;
  overflow-x: auto;
}

/* 记忆区表格（markdown渲染的table） */
details.mem table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

details.mem th {
  background: linear-gradient(135deg, #7EC8A0, #9DD4B0);
  color: #fff;
  padding: 7px 10px;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
}

details.mem td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(126, 200, 160, 0.10);
  background: rgba(255, 255, 255, 0.40);
}

details.mem tr:last-child td {
  border-bottom: none;
}

p.mr {
  font-size: 12px !important;
  color: #7A9A8A !important;
  background: rgba(126, 200, 160, 0.06);
  border-radius: 8px;
  padding: 8px 12px !important;
  margin: 4px 18px 12px !important;
  line-height: 1.5;
  border-left: 2px solid #7EC8A0;
}

/* ===== 行动推荐区 ===== */
details.act {
  border-left: 3px solid #FFD93D;
  background: linear-gradient(135deg, rgba(255, 248, 240, 0.85) 0%, rgba(255, 245, 225, 0.70) 100%);
}

details.act > summary {
  color: #8B7A3A;
}

details.act > summary::after {
  content: "✨";
  margin-left: auto;
  font-size: 15px;
}

details.act p {
  padding: 12px 18px 16px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

details.act l {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.10);
  user-select: none;
  color: #3D2B1F;
  grid-column: span 1;
}

/* 行动差异化 — 每个行动不同配色 */
l.a1 {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.12), rgba(255, 107, 107, 0.04));
  border-left: 3px solid #FF6B6B;
  color: #C44A4A;
}
l.a1::before { content: "🔥 "; font-size: 15px; }

l.a2 {
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.12), rgba(255, 140, 66, 0.04));
  border-left: 3px solid #FF8C42;
  color: #B86A2A;
}
l.a2::before { content: "☀️ "; font-size: 15px; }

l.a3 {
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.12), rgba(255, 107, 138, 0.04));
  border-left: 3px solid #FF6B8A;
  color: #C44A6A;
}
l.a3::before { content: "💕 "; font-size: 15px; }

l.a4 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 215, 0, 0.04));
  border-left: 3px solid #FFD700;
  color: #8B7A3A;
}
l.a4::before { content: "🌟 "; font-size: 15px; }

l.a5 {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.12), rgba(192, 132, 252, 0.04));
  border-left: 3px solid #C084FC;
  color: #7A4A9A;
  grid-column: 1 / -1;
}
l.a5::before { content: "🔮 "; font-size: 15px; }

/* 行动hover效果 */
details.act l:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
l.a1:hover { border-color: #FF4D4D; background: rgba(255, 107, 107, 0.18); }
l.a2:hover { border-color: #FF7A2A; background: rgba(255, 140, 66, 0.18); }
l.a3:hover { border-color: #FF4D7A; background: rgba(255, 107, 138, 0.18); }
l.a4:hover { border-color: #FFC800; background: rgba(255, 215, 0, 0.18); }
l.a5:hover { border-color: #B06CF0; background: rgba(192, 132, 252, 0.18); }

/* ===== 手机 & 网络 ===== */
details.phone {
  border-left: 3px solid #6AB0E0;
}

details.phone > summary {
  color: #4A7A9A;
}

details.phone p {
  padding: 10px 18px 14px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

details.phone f {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(106, 176, 224, 0.06);
  border-radius: 10px;
  border-left: 2px solid rgba(106, 176, 224, 0.20);
}

details.phone t {
  font-weight: 600;
  color: #4A7A9A;
  min-width: 48px;
  font-size: 13px;
}

details.phone i {
  font-style: normal;
  font-weight: 500;
  color: #6A8A9A;
}

details.phone d {
  color: #4A5A6A;
  font-size: 13px;
}

/* ===== 响应式：移动端适配 ===== */
@media (max-width: 540px) {
  ai {
    padding: 12px 10px 18px;
    border-radius: 20px;
  }

  hd {
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 14px;
  }

  article {
    padding: 12px 14px;
    border-radius: 12px;
  }
  article p { font-size: 14px; }

  details {
    border-radius: 12px;
    margin-bottom: 10px;
  }

  summary {
    padding: 11px 14px;
    font-size: 14px;
  }

  details.info p {
    padding: 10px 14px 12px;
    grid-template-columns: 1fr;
    gap: 2px 0;
    font-size: 13px;
  }
  details.info f { min-width: auto; }

  /* NPC 区移动端 */
  details.npc > p:first-of-type {
    grid-template-columns: 1fr;
    gap: 2px 0;
    padding: 10px 14px 6px;
  }

  p.stats { padding: 4px 14px 10px; }
  p.stats l { font-size: 13px; flex-wrap: wrap; }

  v {
    min-width: 36px;
    height: 20px;
    font-size: 11px;
    padding: 0 6px;
  }
  v[data-lv="1"] { width: 20%; }
  v[data-lv="2"] { width: 40%; }
  v[data-lv="3"] { width: 60%; }
  v[data-lv="4"] { width: 80%; }
  v[data-lv="5"] { width: 100%; }

  p.phys { padding: 4px 14px 10px; }
  p.phys l { font-size: 13px; flex-wrap: wrap; }

  p.bd {
    grid-template-columns: 1fr;
    padding: 4px 14px 10px;
    font-size: 13px;
  }

  p.rec { padding: 4px 14px 10px; gap: 4px 14px; }
  p.rec l { font-size: 12.5px; }

  details.npc > p:last-of-type { padding: 4px 14px 12px; font-size: 13px; }

  /* 记忆区移动端 */
  details.mem p { padding: 4px 12px 10px; font-size: 12px; }
  details.mem th,
  details.mem td { padding: 5px 6px; font-size: 11.5px; }
  p.mr { font-size: 11.5px !important; padding: 6px 10px !important; margin: 4px 12px 10px !important; }

  /* 行动区移动端 */
  details.act p {
    grid-template-columns: 1fr;
    padding: 10px 14px 14px;
    gap: 6px;
  }
  details.act l {
    font-size: 13px;
    padding: 8px 12px;
    grid-column: 1 !important;
  }

  /* 手机区移动端 */
  details.phone p { padding: 8px 14px 12px; }
  details.phone f { padding: 6px 10px; flex-wrap: wrap; }
  details.phone t { min-width: auto; }

  c {
    padding: 8px 14px 4px;
    font-size: 13px;
  }
}

/* ===== 小屏幕额外优化 ===== */
@media (max-width: 380px) {
  ai { padding: 8px 6px 14px; }
  hd { font-size: 12.5px; padding: 9px 10px; }
  article { padding: 10px 10px; }
  article p { font-size: 13px; }
  summary { font-size: 13px; padding: 9px 10px; }
  p.stats l { font-size: 12px; }
  v { min-width: 30px; height: 18px; font-size: 10px; }
  l.sd { font-size: 11.5px; }
  details.act l { font-size: 12px; padding: 7px 10px; }
}