@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Quicksand:wght@300;400;500&display=swap');
/* ═══ B平台表格修正（自动注入）═══ */
.rili-markdown-renderer table { display:table!important; table-layout:auto!important; width:100%!important; border-collapse:collapse!important; }
.rili-markdown-renderer table caption { display:table-caption!important; caption-side:top!important; text-align:center!important; padding:8px!important; }
.rili-markdown-renderer thead { display:table-header-group!important; }
.rili-markdown-renderer tbody { display:table-row-group!important; }
.rili-markdown-renderer tr { display:table-row!important; }
.rili-markdown-renderer th, .rili-markdown-renderer td { display:table-cell!important; }
/* ═══ B平台按钮组保护（自动注入 — 防止按钮消失）═══
   原理：B平台消息操作按钮结构为：
   .flex.items-center.gap-1.ml-auto (hover显隐包装)
     └── .bg-muted.rounded.flex.p-0.5 (按钮组容器)
           └── button.rounded-full.size-7 (单个按钮)
   以下规则使用高specificity + !important确保按钮
   不被任何转换后/透传的CSS规则意外隐藏
   ═══════════════════════════════════════════════ */
/* 按钮组容器保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5,
.is-user .bg-muted.rounded.flex.p-0\.5,
.is-assistant .bg-muted.rounded.flex.p-0\.5 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
}
/* 单个按钮保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5 > button,
.is-user .bg-muted.rounded.flex.p-0\.5 > button,
.is-assistant .bg-muted.rounded.flex.p-0\.5 > button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  clip: auto !important;
  clip-path: none !important;
}
/* hover显隐包装层保护 — 仅保留B平台原生的opacity过渡 */
.flex.items-center.gap-1.ml-auto.md\:opacity-0.group-hover\:opacity-100 {
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
/* 操作行保护 */
.flex.w-full.items-center.justify-between.gap-2.px-2 {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
}
/* ── 日记本纸张底 ── */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
  background: linear-gradient(180deg, hsl(30,20%,97%) 0%, hsl(30,20%,92%) 100%) !important;
  border: 1.5px solid hsl(340,30%,75%) !important;
  border-radius: 6px !important;
  box-shadow:
    0 1px 4px hsla(210,10%,15%,.12),
    0 4px 12px hsla(210,10%,15%,.06) !important;
  padding: 18px 20px !important;
}
/* ── 主文本 ── */
.rili-markdown-renderer {
  color: hsl(210,15%,25%) !important;
  font-family: 'Quicksand', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif !important;
  line-height: 1.7 !important;
  font-size: 15px !important;
  background: transparent !important;
}
/* ── <details> 折叠块 ── */
.rili-markdown-renderer details {
  margin: 12px 0;
  border: 1px dashed hsl(340,30%,75%);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}
.rili-markdown-renderer summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Quicksand', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  color: hsl(210,15%,25%);
  background: hsla(340,30%,75%,.2);
  border-radius: 5px;
  list-style: none;
  user-select: none;
  transition: background .2s ease;
}
.rili-markdown-renderer summary::-webkit-details-marker { display: none; }
.rili-markdown-renderer summary::before {
  content: "📖 ";
  margin-right: 4px;
}
.rili-markdown-renderer summary:hover {
  background: hsla(340,30%,75%,.35);
}
.rili-markdown-renderer details[open] summary {
  border-radius: 5px 5px 0 0;
  background: hsla(340,30%,75%,.3);
  border-bottom: 1px dashed hsl(340,30%,75%);
}
.rili-markdown-renderer details[open] > *:not(summary) {
  padding: 12px 14px;
}
.rili-markdown-renderer details[open] > *:last-child {
  border-radius: 0 0 5px 5px;
}
/* ── 底部操作 ── */
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
  color: hsl(210,15%,25%) !important;
  font-weight: 500 !important;
}
/* ── 模型名 ── */
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
  color: hsl(210,10%,50%) !important;
}
/* ── Token 文本 ── */
/* [Token消耗hover逻辑转换未启用]
.text-orange-500 {
  color: hsl(210,15%,25%) !important;
}
*/
.cy-box {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid hsl(210,5%,80%);
    border-radius: 10px;
    margin: 8px 0;
    overflow: hidden;
    box-shadow: 0 4px 6px hsla(210,10%,15%,.08);
    transition: all 0.3s ease;
}
.cy-box:hover {
    border-color: hsl(340,30%,75%);
    box-shadow: 0 6px 12px hsla(210,10%,15%,.14);
}
.cy-title {
    background: linear-gradient(90deg, hsla(340,30%,75%,.18) 0%, rgba(255,255,255,0) 100%);
    padding: 10px 15px;
    font-weight: 700;
    font-family: 'Playfair Display', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
    cursor: pointer;
    color: hsl(340,40%,62%); /* 主角色玫瑰色 */
    user-select: none;
    outline: none;
}
.cy-content {
    padding: 12px 15px;
    font-size: 0.9em;
    line-height: 1.6;
    border-top: 1px dashed hsl(210,5%,80%);
    font-family: 'Quicksand', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}
.cy-content p {
    margin: 4px 0;
}
.cy-label {
    font-weight: 600;
    color: hsl(210,15%,40%); /* 标签用对比色（蓝灰色） */
}
.cy-nsfw-box {
    background: hsla(340,30%,75%,.12);
    border-left: 3px solid hsl(340,30%,75%);
    padding: 8px 10px;
    margin: 8px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.85em;
}
.cy-mem-title {
    font-weight: 700;
    color: hsl(30,25%,42%); /* 暖色调，呼应纸张底色 */
    border-bottom: 1px solid hsl(210,5%,80%);
    margin-top: 8px !important;
    padding-bottom: 2px;
    font-family: 'Playfair Display', 'Songti SC', 'SimSun', 'Noto Serif SC', serif;
}
.cy-choices p {
    background: hsla(210,10%,92%,.55);
    padding: 6px 10px;
    border-radius: 6px;
    margin: 6px 0 !important;
    transition: background 0.2s;
    font-family: 'Quicksand', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}
.cy-choices p:hover {
    background: hsla(340,30%,75%,.25);
}
/* 主角对话样式：沉稳冷峻的深空蓝 */
.mc-talk {
    color: #2b82d9; 
    font-weight: bold;
    transition: all 0.3s ease;
}
.mc-talk:hover {
    color: #1a5c9e;
    text-shadow: 0 0 8px rgba(43, 130, 217, 0.4);
}

/* 苏念对话样式：优雅撩人的玫瑰粉 */
.sn-talk {
    color: #d94876; 
    font-weight: bold;
    transition: all 0.3s ease;
}
.sn-talk:hover {
    color: #b0355c;
    text-shadow: 0 0 8px rgba(217, 72, 118, 0.4);
}