/* 给不同角色的对话上色 */
user-dialogue {
    color: #FF4500; /* 猩红色，给主角用，够醒目！ */
}

partner-dialogue {
    color: #FF69B4; /* 亮粉色，给亲密伴侣，甜就完事了！ */
}

npc-dialogue {
    color: #1E90FF; /* 道奇蓝，给其他路人NPC，清晰不抢戏！ */
}
/* --- 粉萌甜心 UI 引擎启动 --- */

/* 1. 加载状态重构：文案与动画 */
/* 修改加载文案 */
.style_text__zGhNq {
    visibility: hidden !important;
    position: relative !important;
}

.style_text__zGhNq::after {
    content: "福利姬女儿正在输入消息……" !important;
    visibility: visible !important;
    position: absolute !important;
    left: 0 !important;
    white-space: nowrap !important;
    color: #FF69B4 !important;
    font-weight: 600 !important;
}

/* 隐藏原有点闪烁动画 */
.style_dot-flashing__8L91Q {
    display: none !important;
}

/* 注入可爱心形 SVG 动画 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
}

.flex.items-center.justify-center.w-6.h-5::before {
    content: '' !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23FF69B4" d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"><animateTransform attributeName="transform" type="scale" values="1;1.2;1" dur="0.8s" repeatCount="indefinite" /></path></svg>') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    transform-origin: center !important;
}

/* 2. 输入区美化 */
/* 输入框容器圆角与边框 */
.bg-white.border-\[1\.5px\] {
    border-radius: 20px !important;
    border-color: #FFB6C1 !important;
    background-color: #FFF0F5 !important;
    transition: all 0.3s ease !important;
}

.bg-white.border-\[1\.5px\]:focus-within {
    border-color: #FF69B4 !important;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.3) !important;
}

/* 输入框文字颜色 */
#ai-chat-input {
    color: #4A4A4A !important;
}

#ai-chat-input::placeholder {
    color: #FFB6C1 !important;
}

/* 3. 发送按钮美化 */
#ai-send-button {
    background-color: #FF69B4 !important;
    border-radius: 12px !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

#ai-send-button:hover {
    transform: scale(1.1) rotate(5deg) !important;
    background-color: #FF1493 !important;
}

#ai-send-button .icon-icon-send {
    color: #FFFFFF !important;
}

/* 4. 顶部控制栏粉色化 */
#ai-model-selector {
    background-color: #FFF0F5 !important;
    border: 1px solid #FFB6C1 !important;
    border-radius: 15px !important;
}

#ai-model-selector .truncate {
    color: #D81B60 !important;
    font-weight: 600 !important;
}
.markdown-body details {
    border: none;
    margin: 16px 0;
    background-color: transparent;
    overflow: visible;
}
/* ===== 涂鸦风格 Details/Summary ===== */
/* 蜡笔纹理 + 手绘边框 + 不规则形状 */

.markdown-body details {
  --crayon-primary: #2b2b2b;
  --crayon-secondary: #5a5a5a;
  --crayon-accent: #e85d3a;
  --crayon-bg: #fffef9;
  --crayon-border: #3d3d3d;
  --crayon-highlight: #ffe066;
  --crayon-shadow: rgba(59, 46, 30, 0.08);
  --crayon-paper: #fdfbf5;

  border: none;
  margin: 20px 0;
  background-color: transparent;
  overflow: visible;
  position: relative;
}

/* 蜡笔纹理背景（SVG噪点模拟） */
.markdown-body details::before {
  content: '';
  position: absolute;
  inset: -4px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: 12px;
  z-index: 0;
}

/* Summary - 蜡笔胶囊按钮 */
.markdown-body summary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  background-color: var(--crayon-bg);
  color: var(--crayon-primary);
  font-weight: 600;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', 'Comic Neue', 'Architects Daughter', cursive, sans-serif;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    background-color 0.2s ease-out;
  outline: none;
  list-style: none;
  position: relative;
  z-index: 1;

  /* 手绘不规则边框 - 使用多重box-shadow模拟蜡笔笔触 */
  border: 2.5px solid var(--crayon-border);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);

  /* 蜡笔纹理叠加 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' seed='5'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23c)' opacity='0.025'/%3E%3C/svg%3E");
}

.markdown-body summary::-webkit-details-marker {
  display: none;
}

/* 悬停 - 蜡笔涂抹高亮效果 */
@media (hover: hover) {
  .markdown-body summary:hover {
    background-color: var(--crayon-highlight);
    border-color: var(--crayon-accent);
    transform: rotate(-0.5deg) scale(1.02);
    box-shadow:
      3px 3px 0 rgba(232, 93, 58, 0.2),
      -1px -1px 0 rgba(232, 93, 58, 0.1),
      inset 0 0 12px rgba(255, 224, 102, 0.3);
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M5 30 Q15 28 25 31 T45 29 T60 30' stroke='%23e85d3a' stroke-width='0.5' fill='none' opacity='0.2'/%3E%3Cpath d='M0 15 Q20 13 40 16 T60 14' stroke='%23e85d3a' stroke-width='0.3' fill='none' opacity='0.15'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='3' seed='5'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23c)' opacity='0.03'/%3E%3C/svg%3E");
  }
}

/* 焦点 - 蜡笔圈圈 */
.markdown-body summary:focus-visible {
  outline: 3px dashed var(--crayon-accent);
  outline-offset: 4px;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* 点击反馈 */
.markdown-body summary:active {
  transform: rotate(0.3deg) scale(0.98);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

/* 箭头 - 蜡笔手绘三角 */
.markdown-body summary::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4 Q8 3.5 9 5 L18 11 Q19 12 18 13 L9 19 Q7.5 20.5 7 19 Z' fill='none' stroke='%232b2b2b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

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

/* 展开时summary样式变化 */
.markdown-body details[open] > summary {
  border-radius: 225px 15px 15px 15px / 15px 225px 15px 15px;
  border-bottom-color: transparent;
  margin-bottom: 0;
  background-color: var(--crayon-paper);
  box-shadow:
    2px 0px 0 rgba(0, 0, 0, 0.08),
    -1px -1px 0 rgba(0, 0, 0, 0.04);
}

/* 内容区域 - 手绘纸张效果 */
.markdown-body details > pre,
.markdown-body details > table {
  margin-top: 6px;
  background-color: var(--crayon-paper);
  overflow-x: auto;
  position: relative;
  z-index: 1;

  /* 手绘边框 */
  border: 2px solid var(--crayon-border);
  border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
  box-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.1),
    inset 0 0 20px rgba(253, 251, 245, 0.5);

  /* 横线纸张纹理 */
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      rgba(59, 46, 30, 0.06) 27px,
      rgba(59, 46, 30, 0.06) 28px
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' seed='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)' opacity='0.02'/%3E%3C/svg%3E");
}

/* 左侧红色竖线（模拟笔记本） */
.markdown-body details > pre::before,
.markdown-body details > table::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(232, 93, 58, 0.3) 5%,
    rgba(232, 93, 58, 0.3) 95%,
    transparent 100%
  );
  pointer-events: none;
}

/* 隐藏原始边框装饰 */
.markdown-body details pre > div:first-child[style*="border-color"] {
  display: none;
}

.markdown-body details pre {
  margin-left: 0;
  margin-right: 0;
  padding: 0;
}

.markdown-body details pre > div[node="[object Object]"] {
  padding: 16px 16px 16px 44px;
  color: var(--crayon-primary);
  background: transparent !important;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', 'Comic Neue', 'Architects Daughter', monospace;
}

/* 代码文字 - 蜡笔手写感 */
.markdown-body details code.language-markdown {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--crayon-primary);
  background: transparent !important;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', 'Comic Neue', 'Architects Daughter', monospace;
}

/* 表格 - 涂鸦格子 */
.markdown-body details table th,
.markdown-body details table td {
  font-size: 12.5px;
  padding: 8px 12px;
  line-height: 1.4;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', 'Comic Neue', 'Architects Daughter', cursive, sans-serif;
  border-bottom: 1.5px dashed rgba(59, 46, 30, 0.15);
}

.markdown-body details table th {
  background-color: rgba(255, 224, 102, 0.2);
  font-weight: 700;
  border-bottom: 2.5px solid var(--crayon-border);
  position: relative;
}

/* 表头下划线 - 蜡笔涂抹效果 */
.markdown-body details table th::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 4px;
  right: 4px;
  height: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 4'%3E%3Cpath d='M0 2 Q10 0.5 20 2 T40 2 T60 1.5 T80 2.5 T100 2' stroke='%232b2b2b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  background-size: 100% 100%;
  opacity: 0.4;
}

/* 斑马纹 - 蜡笔淡涂 */
.markdown-body details table tr:nth-child(even) td {
  background-color: rgba(255, 224, 102, 0.06);
}

/* 涂鸦装饰 - 角落小星星 */
.markdown-body details > pre::after,
.markdown-body details > table::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 L13.5 8.5 L20 9 L15 13 L16.5 20 L12 16 L7.5 20 L9 13 L4 9 L10.5 8.5 Z' fill='none' stroke='%23e85d3a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' opacity='0.35'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* ===== 展开动画 ===== */
.markdown-body details > pre,
.markdown-body details > table {
  animation: crayon-appear 0.3s ease-out;
}

@keyframes crayon-appear {
  from {
    opacity: 0;
    transform: translateY(-4px) rotate(-0.3deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  .markdown-body summary {
    padding: 12px 18px;
    font-size: 13.5px;
    min-height: 44px;
  }

  .markdown-body details > pre > div[node="[object Object]"] {
    padding: 14px 14px 14px 40px;
  }

  .markdown-body details table th,
  .markdown-body details table td {
    padding: 8px 8px;
    font-size: 12px;
  }

  .markdown-body details > pre,
  .markdown-body details > table {
    border-radius: 8px 40px 8px 40px / 40px 8px 40px 8px;
  }
}
