/* --- 通用重置与基础样式 --- */
/* 隐藏特定背景色元素，通常用于隐藏AI生成界面中的多余元素 */
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* AI回复容器的基础样式 */
.bg-gray-100\/90.relative.inline-block {
    /* 定义CSS变量，便于主题色管理 */
    --blk: #111; /* 黑色 */
    --pnk: #ff007f; /* 粉色 */
    --bg: #fdf6e3; /* 背景色 */
    --grn: #00e676; /* 绿色 */
    --ylw: #ffd600; /* 黄色 */
    
    background-color: var(--bg) !important;
    border: 3px solid var(--blk) !important;
    box-shadow: 4px 4px 0 var(--blk) !important;
    border-radius: 0 15px 15px 15px !important;
    padding: 15px !important;
    color: var(--blk) !important;
    font-family: sans-serif !important;
    line-height: 1.5 !important;
    /* 背景图案 */
    background-image: radial-gradient(var(--blk) 5%, transparent 6%), radial-gradient(var(--blk) 5%, transparent 6%) !important;
    background-size: 20px 20px !important;
    background-position: 0 0, 10px 10px !important;
    isolation: isolate; /* 确保堆叠上下文 */
}

/* AI回复容器的伪元素，用于添加纹理效果 */
.bg-gray-100\/90.relative.inline-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#111 10%, transparent 11%);
    background-size: 12px 12px;
    opacity: .02 !important;
    z-index: -1;
    pointer-events: none; /* 确保不影响鼠标事件 */
    border-radius: inherit; /* 继承父元素的圆角 */
}

/* 非聊天答案容器的特殊样式，用于用户输入部分 */
.bg-gray-100\/90.relative.inline-block:not(.chat-answer-container .bg-gray-100\/90) {
    background-color: #00e676 !important; /* 绿色背景 */
    box-shadow: -6px 6px 0 #111 !important; /* 反向阴影 */
    border-radius: 15px 0 15px 15px !important; /* 特殊圆角 */
    background-image: none !important; /* 移除背景图案 */
}

/* Markdown渲染区域的文本样式 */
.markdown-body {
    color: #111 !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Comic Sans MS' !important; /* 字体栈 */
    font-weight: 600 !important;
    z-index: 1; /* 确保在其他元素之上 */
}

/* 按钮和特定文本的样式 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #444 !important;
    font-weight: 900 !important;
    text-transform: uppercase !important; /* 转换为大写 */
}

/* 加载指示器（...）的隐藏 */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important;
}

/* 自定义加载动画容器 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: 40px !important;
    height: 20px !important;
    overflow: hidden !important;
}

/* 自定义加载动画的伪元素，使用SVG动画 */
.flex.items-center.justify-center.w-6.h-5::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 10'%3E%3Crect x='0' y='1' width='8' height='8' fill='%23111111'%3E%3Canimate attributeName='opacity' values='1;0.2;1' dur='0.9s' begin='0s' repeatCount='indefinite'/%3E%3C/rect%3E%3Crect x='14' y='1' width='8' height='8' fill='%23ff007f'%3E%3Canimate attributeName='opacity' values='1;0.2;1' dur='0.9s' begin='0.3s' repeatCount='indefinite'/%3E%3C/rect%3E%3Crect x='28' y='1' width='8' height='8' fill='%2300e676'%3E%3Canimate attributeName='opacity' values='1;0.2;1' dur='0.9s' begin='0.6s' repeatCount='indefinite'/%3E%3C/rect%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* 隐藏思维链的<think>标签 */
think {
    display: none !important;
}

/* --- 自定义AI内容区样式 --- */
ai {
    /* 继承并定义AI内容区特有的CSS变量 */
    --bg: #fdf6e3;
    --blk: #111;
    --grn: #00e676;
    --pnk: #ff007f;
    --ylw: #ffd600;
    --bdr: 3px solid var(--blk); /* 边框样式 */
    --shd: 4px 4px 0 var(--blk); /* 阴影样式 */
    display: block; /* 确保AI标签作为一个块级元素 */
}

/* 头部信息（日期、地点） */
ai hd {
    display: flex;
    justify-content: space-between;
    background: var(--blk);
    color: var(--ylw);
    padding: 8px 12px;
    font-weight: 900;
    border: var(--bdr);
    box-shadow: var(--shd);
    margin-bottom: 15px;
    transform: rotate(-1deg); /* 轻微倾斜 */
    font-size: 13px;
    flex-wrap: wrap; /* 允许换行 */
    gap: 5px;
}
ai hd span {
    background: var(--blk);
    padding: 2px 5px;
}

/* 剧情文本区 */
ai text {
    display: block;
    background: #fff;
    padding: 15px;
    border: var(--bdr);
    box-shadow: var(--shd);
    margin-bottom: 20px;
    font-size: 15px;
    text-align: justify;
}
ai text p {
    margin-bottom: 10px; /* 段落间距 */
}

/* 折叠面板容器 */
ai details {
    margin-bottom: 12px;
}

/* 折叠面板摘要（标题） */
ai summary {
    list-style: none; /* 移除默认列表标记 */
    cursor: pointer;
    background: #fff;
    border: var(--bdr);
    box-shadow: var(--shd);
    padding: 10px 15px;
    font-weight: 900;
    font-size: 15px;
    display: inline-block;
    transform: skew(-5deg); /* 倾斜效果 */
    transition: .2s; /* 过渡动画 */
    position: relative;
    user-select: none; /* 禁止选择文本 */
}
ai summary::-webkit-details-marker {
    display: none; /* 隐藏Webkit浏览器的默认标记 */
}

/* 折叠面板摘要的伪元素（加号/减号图标） */
ai summary::after {
    content: '+';
    position: absolute;
    right: -15px;
    top: -10px;
    background: var(--ylw);
    color: var(--blk);
    border: 2px solid var(--blk);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border-radius: 50%; /* 圆形 */
    transform: rotate(10deg);
}

/* 折叠面板打开时的摘要样式 */
ai details[open]>summary {
    background: var(--blk);
    color: var(--ylw);
    transform: translate(2px, 2px) skew(-5deg); /* 视觉下沉效果 */
    box-shadow: 2px 2px 0 var(--pnk);
}
ai details[open]>summary::after {
    content: '-'; /* 改变为减号 */
    background: var(--pnk);
    color: #fff;
}

/* 信息框容器 */
ai box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: var(--bdr);
    padding: 12px;
    margin-top: 10px;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.05); /* 内阴影 */
    position: relative;
}

/* 信息框顶部的装饰线 */
ai box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(45deg, var(--blk), var(--blk) 10px, transparent 10px, transparent 20px); /* 重复线性渐变 */
}

/* NPC信息框的特殊边框颜色 */
ai box.npc {
    border-color: var(--pnk);
}

/* 少女心音信息框的特殊样式 */
ai box.mind {
    background: var(--pnk);
    color: #fff;
    border-radius: 15px;
    border-top-left-radius: 0;
}

/* 记忆笔记信息框的特殊样式 */
ai box.memo {
    background: #f4f4f4;
}

/* 传闻轶事信息框的特殊样式 */
ai box.news {
    background: var(--blk);
    color: #fff;
}

/* 数据行（例如：姓名、身份） */
ai d {
    display: flex;
    align-items: flex-start;
    background: rgba(0,0,0,.03);
    padding: 4px 6px;
}
ai d b {
    min-width: 65px;
    background: var(--grn);
    color: var(--blk);
    padding: 2px 6px;
    margin-right: 8px;
    font-size: 12px;
    text-align: center;
    border: 1px solid var(--blk);
    transform: skew(-5deg);
}
ai box.npc d b {
    background: var(--pnk);
    color: #fff;
}

/* 好感度条目 */
ai lv {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    background: #fff;
    padding: 8px;
    border: 2px dashed var(--pnk); /* 虚线边框 */
    margin-top: 5px;
}
ai lv b {
    background: var(--blk);
    color: var(--ylw);
    padding: 2px 6px;
    font-size: 12px;
}
ai lv span {
    font-weight: 900;
    color: var(--pnk);
}
ai lv i {
    font-size: 12px;
    color: #666;
    width: 100%; /* 确保占据整行 */
}

/* 进度条 */
ai bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border: 2px solid var(--blk);
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}
ai bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--v); /* 宽度由CSS变量控制 */
    background: linear-gradient(90deg, var(--pnk), #ff66a3); /* 渐变色 */
    box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}

/* 引用文本（心音独白） */
ai q {
    display: block;
    font-style: italic;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    padding-left: 10px;
}
ai q b {
    color: var(--ylw);
    margin-right: 5px;
    font-style: normal;
    text-transform: uppercase;
}

/* 记忆笔记标记 */
ai mr {
    font-size: 12px;
    color: #555;
    border-bottom: 2px dotted #ccc;
    padding-bottom: 5px;
    margin-bottom: 5px;
}
ai mr b {
    color: var(--blk);
}

/* 记忆笔记内部details的摘要样式 */
ai box.memo details summary {
    background: none;
    box-shadow: none;
    border: none;
    border-bottom: 2px solid var(--blk);
    transform: none;
    padding: 5px 0;
    width: 100%;
    color: var(--blk);
}
ai box.memo details[open]>summary {
    background: var(--ylw);
    color: var(--blk);
    padding-left: 10px;
}
ai box.memo details summary::after {
    display: none; /* 隐藏加号/减号图标 */
}
ai box.memo p {
    font-size: 13px;
    padding: 8px;
    background: #fff;
    border-left: 3px solid var(--ylw);
    margin-top: 5px;
}

/* 传闻轶事段落样式 */
ai box.news p {
    font-size: 13px;
    font-family: monospace; /* 等宽字体 */
    color: var(--grn);
}

/* 选项框容器 */
ai box.opts {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 10px;
}
ai box.opts::before {
    display: none; /* 隐藏顶部的装饰线 */
}

/* 选项A, B, C, D 的样式 */
ai a {
    display: flex;
    align-items: center;
    background: #fff;
    border: var(--bdr);
    box-shadow: var(--shd);
    padding: 10px;
    font-weight: 700;
    cursor: default; /* 禁用鼠标指针变化 */
    transition: .1s;
    pointer-events: none; /* 禁用所有鼠标事件，防止成为超链接 */
}
ai a b {
    background: var(--blk);
    color: #fff;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 14px;
}
/* 移除 hover 和 active 效果，因为选项不再是可点击的 */
/* ai a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--grn);
}
ai a:active {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 var(--blk);
} */