/* =========================================================
   桃色主题聊天框全局美化 (Erotic Pink Theme)
   ========================================================= */

/* 1. 消除默认边框，添加基础毛玻璃滤镜与圆角 */
.group.is-user > div:first-child, 
.group.is-assistant > div:first-child {
    border: none !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border-radius: 18px !important;
    position: relative !important;
    isolation: isolate !important; 
}

/* 2. User输入框 */
.group.is-user > div:first-child {
    background: linear-gradient(135deg, rgba(60, 15, 35, 0.85), rgba(40, 10, 25, 0.95)) !important;
    box-shadow: inset 0 0 12px rgba(255, 105, 180, 0.15), 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 105, 180, 0.25) !important;
}

/* 3. Assistant输出框 */
.group.is-assistant > div:first-child {
    background: linear-gradient(145deg, rgba(215, 35, 100, 0.85), rgba(130, 15, 65, 0.9)) !important;
    box-shadow: 0 0 25px rgba(255, 20, 147, 0.35), inset 0 0 20px rgba(255, 192, 203, 0.2) !important;
    border: 1px solid rgba(255, 105, 180, 0.5) !important;
}

/* 4. 添加暧昧的光泽遮罩层 */
.group.is-assistant > div:first-child::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: radial-gradient(circle at 80% 20%, rgba(255, 182, 193, 0.25), transparent 60%) !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

/* 5. 强制文字为纯白并增加极轻微阴影 */
.group.is-user .rili-markdown-renderer, 
.group.is-user .rili-markdown-renderer *,
.group.is-assistant .rili-markdown-renderer, 
.group.is-assistant .rili-markdown-renderer * {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

.rili-markdown-renderer strong {
    color: #ff9ebd !important; 
    text-shadow: 0 0 8px rgba(255, 105, 180, 0.4) !important;
}

/* 6. 底部Token消耗与模型信息 */
.group .text-xs.font-mono.text-muted-foreground {
    color: rgba(255, 182, 193, 0.7) !important;
    text-shadow: 0 0 4px rgba(255, 20, 147, 0.3) !important;
}

/* 7. 底部操作按钮区美化 */
.group .md\:opacity-0 {
    opacity: 1 !important; 
}
.group .bg-muted.rounded.flex {
    background-color: rgba(255, 105, 180, 0.15) !important;
    backdrop-filter: blur(6px) !important;
    border: 1px solid rgba(255, 105, 180, 0.3) !important;
}
.group .bg-muted.rounded.flex button svg.lucide {
    stroke: rgba(255, 220, 230, 0.9) !important; 
}
.group .bg-muted.rounded.flex button:hover {
    background-color: rgba(255, 20, 147, 0.4) !important; 
}

/* 8. 加载动画改造 */
.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::before {
    content: "" !important;
    width: 32px !important;
    height: 32px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff1493'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3Canimate attributeName='r' values='7;11;7' dur='1.8s' repeatCount='indefinite'/%3E%3Canimate attributeName='opacity' values='0.4;1;0.4' dur='1.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: drop-shadow(0 0 8px rgba(255, 20, 147, 0.8)) !important;
}

/* =========================================================
   修复：状态栏容器与视觉美化区 (强制加入底色对抗白底)
   ========================================================= */

ai {
    --pink-base: #ff9ebd;
    --pink-hot: #ff1493;
    --pink-border: rgba(255, 105, 180, 0.5);
    display: block;
    margin: 10px 0;
    font-size: 13px;
    color: #ffe6f0 !important;
    line-height: 1.4;
}

/* 顶部情境标头 */
ai hd {
    display: block;
    background: linear-gradient(90deg, rgba(100, 10, 45, 0.95), rgba(215, 35, 100, 0.8), transparent) !important;
    border-left: 4px solid var(--pink-hot) !important;
    padding: 6px 10px;
    margin-bottom: 12px;
    border-radius: 4px 15px 15px 4px;
    font-weight: bold;
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
}

/* 折叠面板 (状态卡片主体) - 强制深色底 */
ai details {
    background: rgba(25, 5, 15, 0.85) !important; /* 极深的暗紫红，确保压住白底 */
    border: 1px solid var(--pink-border) !important;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

ai details[open] {
    background: rgba(45, 5, 25, 0.9) !important;
    box-shadow: inset 0 0 25px rgba(255, 20, 147, 0.3), 0 5px 20px rgba(0,0,0,0.6) !important;
    border-color: rgba(255, 20, 147, 0.8) !important;
}

/* 标题样式 */
ai summary {
    font-weight: bold;
    color: #ffb6c1 !important;
    text-shadow: 0 0 10px rgba(255, 20, 147, 0.8) !important;
    cursor: pointer;
    outline: none;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--pink-border) !important;
    margin-bottom: 8px;
    list-style: none;
}
ai summary::-webkit-details-marker {
    display: none !important;
}
ai summary:hover {
    color: #fff !important;
    text-shadow: 0 0 15px #ff1493, 0 0 5px #ff1493 !important;
}

/* 机制分类与装饰标题 */
ai p {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
ai p::before {
    content: attr(t);
    background: linear-gradient(90deg, rgba(215, 35, 100, 0.7), transparent) !important;
    border-left: 3px solid var(--pink-base) !important;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #fff !important;
    width: 100%;
    margin-bottom: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
    border-radius: 2px;
}

/* 常规状态小方块 - 强制黑色半透明底 */
ai d {
    background: rgba(0, 0, 0, 0.6) !important; 
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 182, 193, 0.25) !important;
    display: inline-block;
    color: #ffd1dc !important; /* 浅粉白字 */
}

/* 重点高亮特效 (h) - 桃色霓虹脉冲 */
ai h {
    color: #ffffff !important;
    font-weight: bold !important;
    text-shadow: 0 0 4px #ff1493, 0 0 8px #ff1493 !important;
    animation: hot-pulse 1.5s infinite alternate ease-in-out !important;
}

@keyframes hot-pulse {
    0% {
        text-shadow: 0 0 4px #ff1493, 0 0 8px #ff1493;
        color: #ffe6f0;
    }
    100% {
        text-shadow: 0 0 8px #ff1493, 0 0 15px #ff1493, 0 0 25px rgba(255, 20, 147, 0.8);
        color: #ffffff;
    }
}