/* ==========================================
   兄妹手帐主题 · 高级互动风格
   Rilichat 完整适配 · 兄妹互动特别版
   ========================================== */

/* ---------- 全局色调与字体 ---------- */
:root {
  --bg-paper: #fffaf5;            /* 暖白手帐纸 */
  --accent-pink: #f8a5c2;        /* 妹妹的樱花粉 */
  --accent-blue: #7eb8da;        /* 哥哥的天空蓝 */
  --border-soft: #e6d7c9;        /* 浅棕边框 */
  --text-main: #4a3b3c;          /* 深棕文字 */
  --text-title: #b45f6b;         /* 玫瑰金标题 */
}

/* 聊天背景（如果可覆盖） */
body, .chat-container {
  background-color: #fdf6f0;
  background-image: radial-gradient(circle at 30% 70%, rgba(255,210,210,0.15) 0%, transparent 50%);
}

/* ========== 聊天气泡通用 ========== */
.is-user > div,
.is-assistant > div {
  background: var(--bg-paper);
  border: 2px solid var(--border-soft);
  border-radius: 20px 6px 20px 6px;
  box-shadow: 0 4px 15px rgba(180, 95, 107, 0.12);
  padding: 18px 22px;
  font-family: 'PingFang SC', 'Hiragino Sans', 'Microsoft YaHei', sans-serif;
  color: var(--text-main);
  position: relative;
  transition: all 0.25s;
}

/* 哥哥发言气泡（用户） - 蓝色系折角 */
.is-user > div {
  background: linear-gradient(135deg, #f0f7fc 0%, #ffffff 100%);
  border-color: var(--accent-blue);
  border-radius: 6px 20px 6px 20px;
}

/* 妹妹发言气泡（助手） - 粉色系折角 + 专属爱心角标 */
.is-assistant > div {
  background: linear-gradient(135deg, #fff5f7 0%, #ffffff 100%);
  border-color: var(--accent-pink);
  border-radius: 20px 6px 20px 6px;
}

/* 气泡内文本 */
.rili-markdown-renderer {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
  text-shadow: none;
  background: transparent;
}

/* 粗体强调：玫瑰粉 */
.rili-markdown-renderer strong {
  color: #d86b83;
}

/* 链接：天蓝 */
.rili-markdown-renderer a {
  color: #5a9bc7;
  border-bottom: 1px dashed #5a9bc7;
}

/* ========== 底部按钮 ========== */
.is-assistant > div button,
.is-user > div button {
  background: rgba(255,245,240,0.8);
  color: #8e6b6f;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  font-size: 0.82em;
  padding: 4px 14px;
  transition: all 0.25s;
}
.is-assistant > div button:hover,
.is-user > div button:hover {
  background: #fde2e8;
  color: #b45f6b;
  border-color: var(--accent-pink);
  box-shadow: 0 4px 10px rgba(248,165,194,0.25);
}
.is-assistant > div button svg,
.is-user > div button svg {
  stroke: #8e6b6f;
}
.is-assistant > div button:hover svg,
.is-user > div button:hover svg {
  stroke: #b45f6b;
}

/* ========== 状态栏 (Details) 手帐卡片 ========== */
.rili-markdown-renderer details {
  margin: 14px 0;
  border: 2px solid #f3d5df;
  border-radius: 16px;
  background: rgba(255, 250, 245, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(200, 160, 170, 0.2);
  overflow: hidden;
  transition: 0.3s;
}
.rili-markdown-renderer details[open] {
  background: #fffdfb;
  border-color: var(--accent-pink);
  box-shadow: 0 6px 18px rgba(200, 120, 140, 0.25);
}

/* 标题栏：像妹妹贴的便签条 */
.rili-markdown-renderer summary {
  padding: 12px 20px;
  font-weight: 600;
  color: #c25b6e;
  background: linear-gradient(90deg, #fff0f3, #fff);
  border-bottom: 1px dashed #f3cbd8;
  cursor: pointer;
  list-style: none;
  font-size: 1.05em;
  display: flex;
  align-items: center;
}
.rili-markdown-renderer summary:hover {
  background: linear-gradient(90deg, #fde2e8, #fff);
  color: #a14455;
}

/* 自定义展开符号：心形箭头 */
.rili-markdown-renderer summary::after {
  content: '♥';
  margin-left: auto;
  font-size: 1.1em;
  color: #f08aa8;
  transition: transform 0.3s;
}
.rili-markdown-renderer details[open] > summary::after {
  transform: rotate(180deg);
}
.rili-markdown-renderer summary::-webkit-details-marker {
  display: none;
}

/* 折叠内容区：手帐格子内页 */
.rili-markdown-renderer details > :not(summary) {
  padding: 16px 22px;
  background: 
    linear-gradient(to bottom, #fff, #fff 23px, #f7e8ee 24px);
  background-size: 100% 24px;
  color: #4a3b3c;
  border-top: none;
  font-size: 15px;
  line-height: 1.8;
}

/* 表格：兄妹记录簿 */
.rili-markdown-renderer details table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.6);
}
.rili-markdown-renderer details th,
.rili-markdown-renderer details td {
  border: 1px solid #f3d5df;
  padding: 6px 10px;
  text-align: left;
}
.rili-markdown-renderer details th {
  background: #fff0f3;
  color: #b45f6b;
  font-weight: 600;
}

/* 代码块 */
.rili-markdown-renderer code {
  background: #fef0f4;
  color: #d86b83;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: 'Consolas', monospace;
}

/* 特殊内容块 */
.rili-markdown-renderer .story-body {
  text-align: justify;
  line-height: 2;
  margin: 8px 0;
  padding: 10px;
}
.rili-markdown-renderer .story-body strong {
  color: #d86b83;
}

/* 兄妹小剧场分隔线 */
.rili-markdown-renderer hr {
  border: none;
  border-top: 2px dotted #f3cbd8;
  margin: 20px 0;
}

/* ========== 输入框区域 ========== */
div[data-slot="input-group"] {
  background: rgba(255, 250, 245, 0.95);
  border: 2px solid #f3d5df;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(200, 120, 140, 0.15);
}
div[data-slot="input-group"]:focus-within {
  border-color: var(--accent-pink);
  box-shadow: 0 0 12px rgba(248,165,194,0.4);
}

#prompt-input textarea {
  background: transparent;
  color: #4a3b3c;
  font-family: 'PingFang SC', sans-serif;
  font-size: 16px;
}

/* 发送按钮：渐变粉蓝兄妹配色 */
#prompt-input-footer button[type="submit"] {
  background: linear-gradient(135deg, #7eb8da, #f8a5c2);
  color: #fff;
  border: none;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(180, 95, 107, 0.3);
  transition: 0.25s;
}
#prompt-input-footer button[type="submit"]:hover {
  background: linear-gradient(135deg, #5a9bc7, #f28bae);
  box-shadow: 0 6px 16px rgba(180, 95, 107, 0.5);
  transform: scale(1.02);
}

/* ========== 加载动画：旋转兄妹头像 (纸飞机替换为双心) ========== */
.style_dot-flashing__8L91Q {
  display: none !important;
}
.sonner-loading-wrapper,
.flex.items-center.justify-center.w-6.h-5 {
  position: relative;
  width: 28px !important;
  height: 28px !important;
}
.sonner-loading-wrapper::before,
.flex.items-center.justify-center.w-6.h-5::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f8a5c2' 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'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='1.5s' repeatCount='indefinite'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.sonner-loading-wrapper::after,
.flex.items-center.justify-center.w-6.h-5::after {
  content: '妹妹在写字...';
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 8px;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 13px;
  color: #c25b6e;
  font-family: 'PingFang SC', sans-serif;
}

/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
  .is-user > div,
  .is-assistant > div {
    padding: 14px 16px;
    border-radius: 14px 6px 14px 6px;
  }
  .is-assistant > div::after {
    font-size: 11px;
    padding: 2px 12px;
    top: -12px;
    right: 8px;
  }
  .rili-markdown-renderer {
    font-size: 15px;
  }
}