/* ============================================
   ASMR甜腻支配风 — 运动性爱主题
   蜜桃粉 · 玫瑰红 · 紫霞紫 · 奶油白
   ============================================ */

/* --- 容器根变量 --- */
ai {
  --primary: #ff2a6d;
  --secondary: #b768ff;
  --pink: #ff99b3;
  --pink-deep: #ff2a6d;
  --purple: #b768ff;
  --purple-soft: #f0e0ff;
  --cream: #fff5f8;
  --text: #4a3040;
  --text-light: #7a5870;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(255, 42, 109, 0.1);
  display: block;
  background: var(--cream);
  border-radius: 16px;
  padding: 18px 16px;
  max-width: 100%;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 42, 109, 0.1);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
ai::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -40px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 153, 179, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
ai::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(183, 104, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* --- 标题 --- */
hd {
  display: block;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  padding: 6px 0 10px;
}
hd::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--pink), var(--purple), transparent);
  border-radius: 2px;
  animation: hdPulse 3s ease-in-out infinite;
}
@keyframes hdPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- 分隔线 --- */
line {
  display: block;
  height: 2px;
  margin: 12px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 42, 109, 0.2), rgba(183, 104, 255, 0.2), rgba(255, 42, 109, 0.2), transparent);
  border: none;
  border-radius: 1px;
}

/* --- 阶段标签 --- */
q {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.2), rgba(183, 104, 255, 0.2));
  color: var(--primary);
  margin-bottom: 12px;
  position: relative;
  border: 1px solid rgba(255, 42, 109, 0.2);
}
q[stage="exercise"] { 
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.3), rgba(183, 104, 255, 0.2)); 
  color: #e81e63; 
  border-color: rgba(255, 42, 109, 0.3); 
}
q[stage="survive"] { 
  background: rgba(139, 195, 74, 0.15); 
  color: #558b2f; 
  border-color: rgba(139, 195, 74, 0.3); 
}
q[stage="nsfw"] { 
  background: rgba(255, 105, 180, 0.3); 
  color: #c2185b; 
  border-color: rgba(255, 105, 180, 0.4); 
}
q::before {
  content: "♥";
  font-size: 10px;
  margin-right: 5px;
  animation: heartBeat 1.5s ease-in-out infinite;
  display: inline-block;
}
@keyframes heartBeat {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* --- 正文段落 --- */
p {
  display: block;
  margin: 8px 0;
  text-indent: 1.5em;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}

/* --- 折叠面板 --- */
details {
  display: block;
  margin: 12px 0;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(255, 42, 109, 0.1);
  overflow: hidden;
  box-shadow: var(--shadow);
}
details[open] {
  border-color: rgba(255, 42, 109, 0.3);
}
details[open] > summary {
  border-bottom: 1px solid rgba(255, 42, 109, 0.2);
  background: linear-gradient(180deg, rgba(255, 153, 179, 0.05) 0%, #fff 100%);
}
summary {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  position: relative;
  background: #fff;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}
summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  font-size: 11px;
  transition: transform 0.3s;
  color: var(--pink);
}
details[open] > summary::before {
  transform: rotate(90deg);
  color: var(--primary);
}
summary::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 42, 109, 0.2), rgba(183, 104, 255, 0.2), transparent);
  border-radius: 1px;
}
details[open] > summary::after {
  background: linear-gradient(90deg, transparent, var(--pink), var(--purple), transparent);
  animation: summaryLineGlow 2s ease-in-out infinite;
}
@keyframes summaryLineGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- 通用状态块 --- */
t {
  display: block;
  padding: 10px 14px;
  margin: 6px 10px;
  border-radius: 10px;
  border-left: 4px solid transparent;
}

/* 主角 */
t[n="主角"] {
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.1) 0%, #fff 100%);
  border-left-color: var(--primary);
}

/* NPC */
t[n="npc"] {
  background: linear-gradient(135deg, rgba(183, 104, 255, 0.1) 0%, #fff 100%);
  border-left-color: var(--secondary);
}

/* 身体档案 */
t[n="body"] {
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.15) 0%, #fff 100%);
  border-left-color: var(--pink-deep);
  border: 1px dashed rgba(255, 42, 109, 0.2);
  margin: 10px;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
t[n="body"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 42, 109, 0.15);
}

/* 角色列表 */
t[n="roster"] {
  background: #fdfdfb;
  border-left-color: var(--purple);
  font-size: 13px;
}

/* 地图 */
t[n="map"] {
  background: linear-gradient(135deg, rgba(183, 104, 255, 0.08) 0%, #fff 100%);
  border-left-color: var(--secondary);
}

/* 任务 */
t[n="quest"] {
  background: rgba(255, 153, 179, 0.08);
  border-left-color: var(--primary);
}

/* 记忆 */
t[n="memory"] {
  background: linear-gradient(135deg, rgba(183, 104, 255, 0.1) 0%, rgba(255, 153, 179, 0.05) 100%);
  border-left-color: var(--purple);
}

/* --- 标签名 f --- */
f {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  color: var(--primary);
  background: rgba(255, 153, 179, 0.2);
  padding: 2px 10px;
  border-radius: 12px;
  margin-right: 8px;
  margin-bottom: 4px;
  white-space: nowrap;
}
t[n="npc"] f {
  color: var(--secondary);
  background: rgba(183, 104, 255, 0.2);
}
t[n="body"] f {
  color: #d81b60;
  background: rgba(255, 153, 179, 0.3);
  font-size: 11px;
}
t[n="map"] f {
  color: #7b1fa2;
  background: rgba(183, 104, 255, 0.2);
}
t[n="quest"] f {
  color: #d81b60;
  background: rgba(255, 153, 179, 0.25);
}
t[n="memory"] f {
  color: #7b1fa2;
  background: rgba(183, 104, 255, 0.2);
}
t[n="roster"] f {
  color: #9c27b0;
  background: rgba(183, 104, 255, 0.15);
}

/* --- 数据行 d --- */
d {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  padding: 2px 0 2px 16px;
  position: relative;
}
d::before {
  content: "·";
  position: absolute;
  left: 6px;
  color: var(--pink);
  font-weight: bold;
  font-size: 12px;
}
t[n="npc"] d::before { color: var(--purple); }
t[n="body"] d::before { color: var(--primary); }
t[n="map"] d::before { color: var(--secondary); }
t[n="quest"] d::before { color: var(--pink); }
t[n="memory"] d::before { color: var(--purple); }

d:first-of-type {
  margin-top: 4px;
}

/* 角色列表 d 特殊 */
t[n="roster"] d {
  padding-left: 18px;
}
t[n="roster"] d::before {
  content: "▹";
  left: 6px;
  color: #ddd;
  font-size: 10px;
}

/* --- 菜单 --- */
menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 6px 6px;
  padding: 0;
  list-style: none;
}
menu i {
  display: inline-block;
  font-style: normal;
  font-size: 12px;
  padding: 8px 18px;
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.1) 0%, #fff 100%);
  border: 1px solid rgba(255, 42, 109, 0.25);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
menu i:hover {
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.3) 0%, rgba(255, 42, 109, 0.1) 100%);
  border-color: var(--pink);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(255, 42, 109, 0.2);
  color: #c2185b;
}

/* ====================== 修改代码块间距：消除上下margin，贴紧排列 ====================== */
.markdown-body pre {
  border-radius: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 42, 109, 0.15) !important;
  background: #fdfbf9 !important;
}

/* 相邻代码块共用一条边框，消除缝隙 */
.markdown-body pre + pre {
  border-top: none !important;
}

/* --- 带语言标识的主容器 --- */
.markdown-body pre > div {
  border-radius: 0 !important;
  background: #fdfbf9 !important;
}

/* --- 头部栏 --- */
.markdown-body pre > div > div.flex.justify-between.h-8,
.markdown-body pre > div > div.border-b {
  background: linear-gradient(135deg, rgba(255, 153, 179, 0.15) 0%, rgba(183, 104, 255, 0.1) 100%) !important;
  border-bottom: 1px solid rgba(255, 42, 109, 0.15) !important;
  border-color: rgba(255, 42, 109, 0.15) !important;
}

/* --- 语言标签 --- */
.markdown-body pre > div > div.flex.justify-between > div.text-\[13px\],
.markdown-body pre > div > div.flex.justify-between > div:first-child {
  color: var(--primary, #ff2a6d) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  background: transparent !important;
}

/* --- 按钮包装区 --- */
.markdown-body pre > div > div.flex.justify-between > div:last-child {
  background: transparent !important;
}

/* --- 复制按钮外层 --- */
.markdown-body pre div[data-tooltip-id^="copy-tooltip"],
.markdown-body pre div.size-5.group[data-tooltip-id^="copy-tooltip"] {
  background: transparent !important;
  border-radius: 8px !important;
  transition: background 0.2s !important;
}
.markdown-body pre div[data-tooltip-id^="copy-tooltip"]:hover,
.markdown-body pre div.size-5.group[data-tooltip-id^="copy-tooltip"]:hover {
  background: rgba(255, 42, 109, 0.08) !important;
}

/* --- 复制图标颜色 --- */
.markdown-body pre svg.lucide-copy,
.markdown-body pre div[data-tooltip-id^="copy-tooltip"] > svg {
  color: #d4a0a8 !important;
  stroke: currentColor !important;
}
.markdown-body pre .group:hover svg.lucide-copy,
.markdown-body pre div[data-tooltip-id^="copy-tooltip"]:hover > svg {
  color: var(--primary) !important;
}

/* --- 代码内容区 --- */
.markdown-body pre > div > div[node],
.markdown-body pre > div > div:last-child {
  background: #fefcfb !important;
  color: #5a4055 !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  border-radius: 0 !important;
}

/* --- 代码元素 --- */
.markdown-body pre code[class^="language-"],
.markdown-body pre > div > div[node] > code {
  background: transparent !important;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace !important;
  font-size: 13px !important;
  color: #5a4055 !important;
}

/* --- 语法高亮 span 柔和化 --- */
.markdown-body pre code[class^="language-"] > span,
.markdown-body pre code span {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace !important;
}

/* --- 无语言标识纯代码块 --- */
.markdown-body pre > code[node] {
  background: #fefcfb !important;
  color: #5a4055 !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  border-radius: 14px !important;
  display: block !important;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace !important;
  border: 1px solid rgba(255, 42, 109, 0.12) !important;
}

.rps-panel {
  background: #fff5f7;
  border: 2px solid #ff6b6b;
  border-radius: 15px;
  padding: 15px;
  margin: 15px 0;
  font-family: sans-serif;
}
.rps-title {
  text-align: center;
  color: #d32f2f;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}
.rps-battle {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.rps-side {
  flex: 1;
  min-width: 80px;
  text-align: center;
}
.rps-label {
  font-size: 12px;
  color: #666;
}
.rps-player-fist {
  font-size: 24px;
  font-weight: bold;
  color: #1976d2;
}
.rps-char-fist {
  font-size: 24px;
  font-weight: bold;
  color: #e91e63;
}
.rps-result {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: bold;
}
.rps-status {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
  text-align: center;
}

/* --- Tooltip 美化（如果平台渲染） --- */
[id^="copy-tooltip"],
.tooltip {
  background: rgba(255, 153, 179, 0.1) !important;
  color: #c2185b !important;
  border: 1px solid rgba(255, 42, 109, 0.2) !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

/* --- 对话颜色标签 --- */
span[style*="color:#2196F3"] {
  color: #1976D2 !important;
  font-weight: 500;
}
span[style*="color:#E91E63"] {
  color: #c2185b !important;
  font-weight: 500;
}
span[style*="color:#FF9800"] {
  color: #f57c00 !important;
  font-weight: 500;
}
span[style*="color:#f44336"] {
  color: #d32f2f !important;
  font-weight: 500;
}
/* ========== 移动端溢出修复，追加到原有CSS底部，一键复制 ========== */
*,
*::before,
*::after {
  box-sizing: border-box !important;
}

ai {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* 绝对定位大伪元素防止溢出，裁剪超出部分 */
ai::before,
ai::after {
  overflow: hidden;
  clip-path: inset(0);
}

/* 状态块t标签，限制最大宽度，margin自适应，防止左右margin撑爆 */
t {
  max-width: 100% !important;
  margin-left: 6px !important;
  margin-right: 6px !important;
}

/* flex菜单核心修复：允许子元素收缩，按钮自动换行，不再横向溢出 */
menu {
  width: 100% !important;
  max-width: 100% !important;
}
menu i {
  min-width: 0 !important;
  flex-shrink: 1 !important;
  white-space: normal !important;
}

/* 图片CG图强制自适应，防止大图溢出屏幕 */
ai img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

/* details折叠面板约束宽度 */
details {
  max-width: 100% !important;
}

/* rps猜拳面板移动端适配 */
.rps-panel {
  max-width: 100% !important;
}
.rps-battle {
  flex-wrap: wrap !important;
}

/* markdown代码块容器防止横向溢出 */
.markdown-body pre {
  max-width: 100% !important;
  overflow-x: auto !important;
}
