/* --------------------------------------
   主题：魅惑深蓝私密房 (蓝底黑丝) + 幻彩VIP金主
   -------------------------------------- */

/* 1. 用户输入框 (告别沉重黑底，幻彩玻璃 + VIP金主装饰) */
.group.is-user > div:first-child {
    /* 核心：使用鲜艳透亮的紫/蓝幻彩渐变，叠加高光点，打破沉闷 */
    background: 
        radial-gradient(circle at top right, rgba(255, 215, 0, 0.25), transparent 60%),
        linear-gradient(135deg, rgba(90, 40, 180, 0.65), rgba(40, 120, 220, 0.55)) !important;
    border: 1px solid rgba(255, 215, 0, 0.5) !important; /* 尊贵金边 */
    box-shadow: 0 8px 20px rgba(0,0,0,0.2), inset 0 0 15px rgba(255, 215, 0, 0.15) !important;
    backdrop-filter: blur(12px) saturate(150%) !important;
    border-radius: 20px 5px 20px 20px !important;
    position: relative !important;
    overflow: visible !important;
    animation: goldShimmer 3s ease-in-out infinite !important; /* 金融流光律动 */
}

/* 用户框右上角专属装饰：VIP徽章 */
.group.is-user > div:first-child::after {
    content: '👑 榜一特权' !important;
    position: absolute !important;
    top: -14px !important;
    right: 0px !important;
    font-size: 11px !important;
    color: #ffd700 !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 8px rgba(255,215,0,0.6) !important;
    z-index: 10 !important;
    padding: 2px 8px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 215, 0, 0.4) !important;
    border-radius: 10px !important;
    backdrop-filter: blur(4px) !important;
}

/* 用户框专属律动：金主光晕呼吸 */
@keyframes goldShimmer {
    0% { box-shadow: 0 8px 20px rgba(0,0,0,0.2), inset 0 0 10px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3), inset 0 0 25px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 8px 20px rgba(0,0,0,0.2), inset 0 0 10px rgba(255, 215, 0, 0.1); }
}

/* 2. AI输出框 (深蓝底色 + 黑色蕾丝网纹 + 律动 - 保持不变) */
.group.is-assistant > div:first-child {
    background: 
        repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0,0,0,0.7) 3px, rgba(0,0,0,0.7) 4px),
        repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(0,0,0,0.7) 3px, rgba(0,0,0,0.7) 4px),
        linear-gradient(135deg, rgba(10, 25, 60, 0.95), rgba(15, 35, 80, 0.85)) !important;
    border: 1px solid rgba(0, 150, 255, 0.5) !important;
    backdrop-filter: blur(16px) !important;
    border-radius: 5px 20px 20px 20px !important;
    position: relative !important;
    isolation: isolate !important;
    animation: bluePulse 2.5s ease-in-out infinite !important;
}

/* 律动心跳动画帧 (蓝色冰火交融感) */
@keyframes bluePulse {
    0% { box-shadow: 0 0 10px rgba(0, 150, 255, 0.2), inset 0 0 5px rgba(0, 150, 255, 0.1); border-color: rgba(0, 150, 255, 0.3); }
    50% { box-shadow: 0 0 25px rgba(0, 191, 255, 0.8), inset 0 0 15px rgba(0, 243, 255, 0.5); border-color: rgba(0, 191, 255, 0.9); }
    100% { box-shadow: 0 0 10px rgba(0, 150, 255, 0.2), inset 0 0 5px rgba(0, 150, 255, 0.1); border-color: rgba(0, 150, 255, 0.3); }
}

/* AI框“私密直播中”标识 */
.group.is-assistant > div:first-child::before {
    content: '🔵 私密互动中' !important;
    position: absolute !important;
    top: -22px !important;
    left: 5px !important;
    font-size: 11px !important;
    color: #00f3ff !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.8) !important;
    z-index: 10 !important;
    animation: livePulse 2s infinite !important;
}

@keyframes livePulse {
    0% { opacity: 0.6; text-shadow: 0 0 2px rgba(0, 243, 255, 0.5); }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(0, 243, 255, 1); }
    100% { opacity: 0.6; text-shadow: 0 0 2px rgba(0, 243, 255, 0.5); }
}

/* 3. 【致命规则】白字的高清可读性强制保障 */
.group.is-user > div:first-child .rili-markdown-renderer,
.group.is-user > div:first-child .rili-markdown-renderer *,
.group.is-assistant > div:first-child .rili-markdown-renderer,
.group.is-assistant > div:first-child .rili-markdown-renderer * {
    color: #ffffff !important;
    letter-spacing: 0.5px !important;
    line-height: 1.7 !important;
}

/* 针对用户框的较亮背景，加深双层黑影，确保白字如雕刻般清晰 */
.group.is-user > div:first-child .rili-markdown-renderer,
.group.is-user > div:first-child .rili-markdown-renderer * {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.9), 0 0 5px rgba(0,0,0,0.8) !important;
}

/* 针对AI框的网纹背景，保持底层压暗阴影 */
.group.is-assistant > div:first-child .rili-markdown-renderer,
.group.is-assistant > div:first-child .rili-markdown-renderer * {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7) !important;
}

/* 4. 底部附属信息与操作按钮优化 */
.text-xs.font-mono.text-muted-foreground {
    color: rgba(100, 200, 255, 0.8) !important;
}
.bg-muted.rounded.flex {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 150, 255, 0.3) !important;
}
.bg-muted.rounded.flex button svg.lucide {
    stroke: rgba(150, 220, 255, 0.9) !important;
}
.group .md\:opacity-0 {
    opacity: 0.4 !important;
    transition: opacity 0.3s ease !important;
}
.group:hover .md\:opacity-0 {
    opacity: 1 !important;
}

/* 5. 挑逗感加载动画 (咬唇与水滴交织) */
.flex.gap-2.w-full.h-full.items-center.justify-center > span {
    display: none !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center {
    position: relative !important;
    min-height: 40px !important;
}
.flex.gap-2.w-full.h-full.items-center.justify-center::after {
    content: '' !important;
    display: block !important;
    width: 120px !important;
    height: 40px !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 40"><text x="40" y="28" font-size="24" text-anchor="middle"><animate attributeName="y" values="28;22;28" dur="1s" repeatCount="indefinite"/><animate attributeName="opacity" values="1;0.6;1" dur="1s" repeatCount="indefinite"/>🫦</text><text x="65" y="28" font-size="20"><animate attributeName="y" values="28;38;28" dur="1.2s" repeatCount="indefinite"/>💦</text><text x="90" y="25" font-size="12" fill="%2300f3ff" font-family="sans-serif"><animate attributeName="opacity" values="0.3;1;0.3" dur="1.5s" repeatCount="indefinite"/>脱衣中...</text></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: drop-shadow(0 0 5px rgba(0,243,255,0.5)) !important;
}

ai, ai p, ai d, ai table, ai td {
  /* 强制锁定深色文本，无视平台暗黑模式的白色字体覆盖 */
  color: #4a3b42 !important; 
}

ai {
  display: block;
  background: #fdf8fa;
  border: 1px solid #ffb6c1;
  border-radius: 12px;
  padding: 10px;
  font-family: sans-serif;
  box-shadow: 0 0 15px rgba(255,105,180,0.15);
  background-image: radial-gradient(#ffe0e9 1px, transparent 1px);
  background-size: 14px 14px;
}

ai hd {
  display: flex;
  justify-content: center;
  gap: 15px;
  background: #1a1518;
  color: #ffb6c1 !important;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-weight: bold;
  font-size: 0.95em;
  border-bottom: 2px solid #ff1493;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

ai f {
  color: #ff1493 !important;
  text-shadow: 0 0 8px #ff1493, 0 0 15px #ff69b4;
  animation: ai-pulse 1.5s infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px #ff1493; }
  50% { opacity: 0.6; text-shadow: none; }
}

ai details {
  margin-bottom: 8px;
  border: 1px solid #ffe4e1;
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 2px 5px rgba(255,182,193,0.2);
}

ai summary {
  background: linear-gradient(90deg, #ffe0e9, #fff0f5);
  padding: 10px 12px;
  font-weight: bold;
  color: #d81b60 !important;
  cursor: pointer;
  list-style: none;
  font-size: 0.95em;
  border-bottom: 1px solid #ffe4e1;
  transition: filter 0.2s;
  position: relative; /* 为右上角装饰提供定位基准 */
}

ai summary:hover {
  filter: brightness(0.95);
}

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

/* ======================================= */
/* 🎀 女儿专属：可爱风右上角悬浮蝴蝶结装饰 */
/* ======================================= */
ai details[v="girl"] summary::after {
  content: "🎀";
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -14px;
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(255,20,147,0.4));
  animation: bow-float 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes bow-float {
  0%, 100% { transform: translateY(0) rotate(15deg); }
  50% { transform: translateY(-4px) rotate(5deg); }
}
/* ======================================= */

ai p {
  margin: 8px;
  padding: 8px;
  background: #fffcfd;
  border-left: 3px solid #ff69b4;
  border-radius: 0 6px 6px 0;
  font-size: 0.9em;
}

ai t {
  display: inline-block;
  background: #ff69b4;
  color: #fff !important;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(255,105,180,0.3);
}

ai d {
  display: block;
  margin: 4px 0;
  padding-bottom: 4px;
  border-bottom: 1px dashed #ffe4e1;
  line-height: 1.5;
}

ai d:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* 弹幕样式 */
ai d[v="chat"] {
  background: #f2f0f5;
  padding: 5px 10px;
  border-radius: 12px 12px 12px 2px;
  border: none;
  margin: 6px 0;
  font-size: 0.9em;
  color: #665b60 !important;
  display: block;
  width: fit-content;
  max-width: 95%;
}

/* 礼物打赏样式 */
ai d[v="gift"] {
  background: linear-gradient(135deg, #fff0e6, #ffe0e9);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ffb6c1;
  border-left: 4px solid #ff1493;
  margin: 8px 0;
  font-weight: bold;
  color: #d81b60 !important;
  box-shadow: 0 3px 6px rgba(255,105,180,0.15);
}

/* 选项按钮样式 */
ai d[v="btn"] {
  background: #fff0f5;
  border: 1px solid #ffb6c1;
  padding: 10px;
  margin: 6px 0;
  border-radius: 6px;
  color: #d81b60 !important;
  font-weight: bold;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 3px 0 #ffb6c1;
}

ai d[v="btn"]:hover {
  transform: translateY(3px);
  box-shadow: 0 0 0 #ffb6c1;
  background: #ffe0e9;
}

/* 性玩具装饰图标 - 内联SVG */
ai d[v="toy"] {
  position: relative;
  padding-left: 20px;
}

ai d[v="toy"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff1493'%3E%3Cpath d='M12 2C9.79 2 8 3.79 8 6v4c0 2.21 1.79 4 4 4s4-1.79 4-4V6c0-2.21-1.79-4-4-4zm-1.5 13v5a1.5 1.5 0 0 0 3 0v-5h-3z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 2px rgba(255,20,147,0.5));
}

/* 表格样式 */
ai table {
  width: calc(100% - 16px);
  margin: 8px;
  font-size: 0.85em;
  border-collapse: collapse;
  background: white;
}

ai th {
  background: #ffe0e9;
  color: #d81b60 !important;
  padding: 6px;
  border: 1px solid #ffb6c1;
}

ai td {
  padding: 6px;
  border: 1px solid #ffe4e1;
}