/* ============================================
   B平台(Rili) 转换版 — 和风樱花主题
   ============================================ */

/* === 统一聊天框：奶油纸感底 + 樱粉描边 === */
/* B平台中，用户和AI的内容气泡都是这个长class的div */
.group.flex.max-w-\[100\%\].flex-col.gap-2 > .is-user\:dark {
    background: linear-gradient(168deg, #fffaf3 0%, #fff4ec 55%, #ffeef0 100%) !important;
    border: 1px solid #f3c9d0 !important;
    border-radius: 18px !important;
    box-shadow: 
        0 4px 18px rgba(243, 201, 208, 0.25),
        0 1px 3px rgba(180, 140, 150, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    padding: 18px 20px !important;
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    transition: box-shadow 0.4s ease, transform 0.4s ease !important;
}

.group.flex.max-w-\[100\%\].flex-col.gap-2 > .is-user\:dark:hover {
    box-shadow: 
        0 6px 24px rgba(243, 201, 208, 0.35),
        0 2px 6px rgba(180, 140, 150, 0.12) !important;
}

/* === AI回复框专属：飘落樱花瓣SVG动效（::before） === */
.is-assistant > .is-user\:dark::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    pointer-events: none !important;
    opacity: 0.55 !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='300' viewBox='0 0 400 300'><defs><g id='p'><path d='M0,-6 C3,-4 4,-2 4,0 C4,3 2,5 0,6 C-2,5 -4,3 -4,0 C-4,-2 -3,-4 0,-6 Z' fill='%23ffd1d9' opacity='0.9'/></g></defs><g><use href='%23p' x='60' y='30'><animateTransform attributeName='transform' type='translate' from='0,-40' to='0,340' dur='14s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='360' dur='6s' additive='sum' repeatCount='indefinite'/></use></g><g><use href='%23p' x='160' y='80'><animateTransform attributeName='transform' type='translate' from='0,-80' to='0,360' dur='18s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='-360' dur='8s' additive='sum' repeatCount='indefinite'/></use></g><g><use href='%23p' x='260' y='10'><animateTransform attributeName='transform' type='translate' from='0,-30' to='0,330' dur='16s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='360' dur='5s' additive='sum' repeatCount='indefinite'/></use></g><g><use href='%23p' x='340' y='60'><animateTransform attributeName='transform' type='translate' from='0,-60' to='0,360' dur='20s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='-360' dur='9s' additive='sum' repeatCount='indefinite'/></use></g><g><use href='%23p' x='110' y='150'><animateTransform attributeName='transform' type='translate' from='0,-20' to='0,200' dur='15s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='360' dur='7s' additive='sum' repeatCount='indefinite'/></use></g><g><use href='%23p' x='220' y='200'><animateTransform attributeName='transform' type='translate' from='0,-50' to='0,150' dur='17s' repeatCount='indefinite'/><animateTransform attributeName='transform' type='rotate' from='0' to='-360' dur='6s' additive='sum' repeatCount='indefinite'/></use></g></svg>") !important;
    background-repeat: repeat !important;
    background-size: 400px 300px !important;
}

/* === 右下角和风印章点缀（::after）— AI回复框 === */
.is-assistant > .is-user\:dark::after {
    content: '✿' !important;
    position: absolute !important;
    right: 14px !important;
    bottom: 8px !important;
    font-size: 14px !important;
    color: #e8a4ae !important;
    opacity: 0.4 !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

/* === 用户输入框：去除动效，更纯净 === */
.is-user > .is-user\:dark {
    background: linear-gradient(160deg, #fdfcf8 0%, #f9f3ee 100%) !important;
    border: 1px dashed #d9c2b8 !important;
}

.is-user > .is-user\:dark::before {
    display: none !important;
}

/* === 主文本：温润墨色，轻小说排印 === */
.rili-markdown-renderer {
    color: #4a3b3f !important;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", -apple-system, "PingFang SC", "Microsoft YaHei", serif !important;
    font-size: 15px !important;
    line-height: 1.85 !important;
    letter-spacing: 0.3px !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

.rili-markdown-renderer strong, 
.rili-markdown-renderer b {
    color: #c25670 !important;
    font-weight: bold !important;
}

.rili-markdown-renderer em {
    color: #8b6f9a !important;
    font-style: italic !important;
}

.rili-markdown-renderer code {
    background: rgba(255, 220, 225, 0.5) !important;
    color: #a04860 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
}

.rili-markdown-renderer blockquote {
    border-left: 3px solid #f3c9d0 !important;
    background: rgba(255, 244, 236, 0.6) !important;
    color: #6a5358 !important;
    padding: 8px 12px !important;
    border-radius: 0 8px 8px 0 !important;
}

.rili-markdown-renderer details {
    background: rgba(255, 250, 245, 0.7) !important;
    border: 1px solid rgba(243, 201, 208, 0.5) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    margin: 8px 0 !important;
}

.rili-markdown-renderer summary {
    color: #b8546b !important;
    font-weight: bold !important;
    cursor: pointer !important;
}

/* === 思维链隐藏 === */
.rili-markdown-renderer think,
think {
    display: none !important;
}

/* === 底部按钮：和果子风 === */
/* B平台按钮在 .bg-muted.rounded.flex.p-0\.5 内 */
.bg-muted.rounded.flex.p-0\.5 > button {
    color: #b07a85 !important;
    background: rgba(255, 240, 240, 0.6) !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    font-size: 13px !important;
}

.bg-muted.rounded.flex.p-0\.5 > button:hover {
    background: rgba(243, 201, 208, 0.5) !important;
    color: #8a4a5a !important;
    transform: translateY(-1px) !important;
}

.bg-muted.rounded.flex.p-0\.5 > button svg {
    stroke: #b07a85 !important;
}

.bg-muted.rounded.flex.p-0\.5 > button:hover svg {
    stroke: #8a4a5a !important;
}

/* === 模型名 & Token 信息 === */
/* B平台的token/模型信息区域 */
.text-xs.font-mono.text-muted-foreground {
    color: #a89090 !important;
    font-size: 12px !important;
    font-style: italic !important;
}

.text-xs.font-mono.text-muted-foreground span {
    color: #d49060 !important;
    font-size: 12px !important;
}

/* token指示点颜色调整 */
.text-xs.font-mono.text-muted-foreground .bg-blue-500\/60 {
    background-color: #e89bb0 !important;
}

.text-xs.font-mono.text-muted-foreground .bg-green-500\/60 {
    background-color: #d49060 !important;
}

/* === 自定义加载动画：三粒和果子跳动 === */
/* B平台加载动画的三个弹跳圆点 */
.flex.gap-2.w-full.h-full.items-center.justify-center > span {
    background: #f3a8b4 !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
}

.flex.gap-2.w-full.h-full.items-center.justify-center > span:nth-child(1) {
    background: #f3a8b4 !important;
}

.flex.gap-2.w-full.h-full.items-center.justify-center > span:nth-child(2) {
    background: #e89bb0 !important;
}

.flex.gap-2.w-full.h-full.items-center.justify-center > span:nth-child(3) {
    background: #d97b9a !important;
}

/* === 移动端适配 === */
@media (max-width: 480px) {
    .group.flex.max-w-\[100\%\].flex-col.gap-2 > .is-user\:dark {
        padding: 14px 16px !important;
        border-radius: 14px !important;
    }
    .rili-markdown-renderer {
        font-size: 14px !important;
        line-height: 1.75 !important;
    }
    .is-assistant > .is-user\:dark::before {
        background-size: 300px 240px !important;
        opacity: 0.4 !important;
    }
}

/* === 低动效偏好 === */
@media (prefers-reduced-motion: reduce) {
    .is-assistant > .is-user\:dark::before {
        opacity: 0.3 !important;
    }
}

/* ============================================
   以下为A平台特有UI组件的样式
   这些组件在B平台可能不存在或结构完全不同
   保留但可能需要根据B平台实际情况调整
   ============================================ */

/* ============================================
   顶部栏：和风纸卷感
   B平台顶部栏结构需要根据实际HTML确认
   ============================================ */

/* ============================================
   底部输入栏：素净纸面
   B平台输入栏选择器需根据实际结构确认
   以下使用通用textarea选择器尝试覆盖
   ============================================ */

/* ============================================
   评论区相关样式
   以下为A平台MUI组件专用，B平台若无对应组件则不生效
   保留以备B平台有类似结构时自动匹配
   ============================================ */

/* 分页栏 */
.MuiPaginationItem-root {
    color: #8a4a5a !important;
    background: rgba(255, 244, 236, 0.6) !important;
    border: 1px solid rgba(243, 201, 208, 0.4) !important;
    border-radius: 10px !important;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", serif !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.MuiPaginationItem-root:hover {
    background: rgba(243, 201, 208, 0.4) !important;
    color: #6a2a40 !important;
    transform: translateY(-1px) !important;
}

.MuiPaginationItem-root.Mui-selected {
    background: linear-gradient(135deg, #f3c9d0 0%, #e89bb0 100%) !important;
    color: #ffffff !important;
    border-color: #d97b9a !important;
    box-shadow: 0 3px 8px rgba(217, 123, 154, 0.4) !important;
}

.MuiPaginationItem-root.Mui-disabled {
    opacity: 0.4 !important;
    color: #c9a8b0 !important;
}

/* 评分星星 — 保留MUI选择器，B平台若有同类组件可生效 */
span.MuiRating-iconEmpty svg {
    color: rgba(243, 201, 208, 0.5) !important;
}

span.MuiRating-iconFilled svg {
    color: #e89bb0 !important;
    filter: drop-shadow(0 1px 3px rgba(232, 155, 176, 0.5)) !important;
    transition: transform 0.3s ease !important;
}

span.MuiRating-iconFilled:hover svg {
    transform: scale(1.15) rotate(10deg) !important;
}

/* 排序按钮 */
button.MuiButton-containedPrimary {
    background: linear-gradient(135deg, #f3c9d0 0%, #e89bb0 100%) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    font-family: "Hiragino Mincho ProN", serif !important;
    box-shadow: 0 2px 8px rgba(232, 155, 176, 0.4) !important;
}

button.MuiButton-outlinedPrimary {
    background: rgba(255, 244, 236, 0.6) !important;
    color: #b07a85 !important;
    border: 1px solid #f3c9d0 !important;
    border-radius: 12px !important;
    font-family: "Hiragino Mincho ProN", serif !important;
}

button.MuiButton-outlinedPrimary:hover {
    background: rgba(243, 201, 208, 0.4) !important;
    color: #8a4a5a !important;
}

/* 评论输入框 textarea */
textarea {
    color: #4a3b3f !important;
    font-family: "Hiragino Mincho ProN", "Yu Mincho", serif !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
}

/* 用户头像边框 */
img.rounded-full {
    border: 2px solid #f3c9d0 !important;
    box-shadow: 0 2px 6px rgba(243, 201, 208, 0.3) !important;
    transition: transform 0.3s ease !important;
}

img.rounded-full:hover {
    transform: scale(1.08) !important;
    border-color: #e89bb0 !important;
}