/* 容器初始化 */
ai {
    display: block;
    background-color: #0f0f12;
    color: #e0e0e0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    padding: 12px;
    border-radius: 10px;
    line-height: 1.6;
    border: 1px solid #2a2a30;
    max-width: 100%;
}

/* 顶部环境栏 */
hd {
    display: block;
    font-size: 11px;
    color: #00d2ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px double #333;
    padding-bottom: 6px;
    margin-bottom: 15px;
    text-align: center;
}

/* 状态栏折叠器通用样式 */
details {
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid #222;
    transition: all 0.3s;
}

summary {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    outline: none;
    background: #1a1a1f;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

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

/* 不同分区的色彩逻辑 */
details[t="main"] summary { border-left: 4px solid #00d2ff; color: #00d2ff; }
details[t="npc"] summary { border-left: 4px solid #ff007a; color: #ff007a; }
details[t="task"] summary { border-left: 4px solid #ffd700; color: #ffd700; }
details[t="phone"] summary { border-left: 4px solid #4ade80; color: #4ade80; }
details[t="act"] summary { border-left: 4px solid #ffffff; color: #fff; background: #333; }

/* 基础信息行 */
d {
    display: block;
    padding: 4px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

f { color: #888; margin-right: 6px; font-size: 12px; }
v { color: #fff; font-weight: 500; }

/* 数值看板 - 高对比度 */
p[t="val"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #000;
    margin: 8px;
    padding: 10px;
    gap: 10px;
    border-radius: 4px;
    border: 1px inset #333;
}

p[t="val"] f { color: #ff007a; font-size: 11px; display: block; margin-bottom: 2px; }
p[t="val"] v { color: #fff; font-family: monospace; font-size: 16px; text-shadow: 0 0 5px #ff007a; }

/* 私密细节区 - 暧昧色调 */
d[t="sec"] {
    background: linear-gradient(90deg, rgba(255,0,122,0.15), transparent);
    border-left: 2px solid #ff007a;
    margin: 4px 0;
    padding: 8px 12px;
    box-shadow: inset 5px 0 10px rgba(255,0,122,0.05);
}
d[t="sec"] v { color: #ff80bf; }

/* 内心想法 */
d[t="thought"] {
    font-style: italic;
    color: #aaa;
    background: rgba(0,0,0,0.2);
    margin: 5px 12px;
    border-radius: 4px;
    padding: 8px;
}

/* 手机动态模拟 */
q {
    display: block;
    margin: 8px 12px;
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    position: relative;
}

q[t="msg"] { background: #2c2c2e; border: 1px solid #3a3a3c; color: #fff; align-self: flex-start; }
q[t="msg"] b { color: #4ade80; display: block; font-size: 10px; margin-bottom: 4px; }

q[t="sns"] { background: #fff; color: #000; border-radius: 4px; }
q[t="sns"] b { color: #1d9bf0; display: block; }
q[t="sns"] i { color: #555; font-size: 11px; }

q[t="web"] { background: #1a1a1b; border: 1px solid #343536; color: #d7dadc; }
q[t="web"] b { color: #ff4500; display: block; }

/* 记忆表格 */
table { width: 100%; border-collapse: collapse; font-size: 11px; margin: 8px 0; }
th { background: #333; color: #fff; padding: 4px; text-align: left; }
td { border: 1px solid #333; padding: 4px; color: #bbb; }

/* 行动推荐区 */
details[t="act"] p {
    padding: 10px 15px;
    background: #000;
    color: #4ade80;
    font-family: monospace;
    font-size: 13px;
}

/* 正文样式 */
article {
    padding: 10px 5px;
    font-size: 16px;
    color: #ececec;
    letter-spacing: 0.5px;
}
/* --- 移除顶部装饰条 --- */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* --- 统一聊天框主体设计 (深红禁锢主题) --- */
.bg-gray-100\/90.relative.inline-block {
    background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%) !important;
    border: 1px solid #8b0000 !important; /* 深红边框 */
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 8px rgba(139, 0, 0, 0.2) !important;
    backdrop-filter: blur(8px) !important;
    margin-bottom: 8px !important;
    padding: 4px !important;
}

/* --- 文本可读性强制覆盖 --- */
.markdown-body {
    color: #ffffff !important; /* 纯白文字确保可读性 */
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    text-shadow: none !important; /* 禁用阴影确保清晰 */
}

/* 强调文字颜色 */
.markdown-body strong {
    color: #ff4d4d !important; 
}

/* --- 底部附加元素 (按钮、Token、模型名) --- */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #b0b0b0 !important; /* 浅灰色，与主文本区分 */
    font-weight: 500 !important;
}

/* 底部按钮悬停效果 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    background-color: rgba(139, 0, 0, 0.2) !important;
    color: #ff4d4d !important;
}

/* --- 加载动画重构：老妹管教计划制定中 --- */

/* 1. 隐藏默认闪烁圆点 */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important;
}

/* 2. 容器调整 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: auto !important;
    min-width: 200px !important;
    height: 24px !important;
    justify-content: flex-start !important;
}

/* 3. 注入SMIL SVG动画 (确保在CSS动画禁用时依然有效) */
.flex.items-center.justify-center.w-6.h-5::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    width: 200px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='24'%3E%3Ctext x='0' y='18' fill='%23ff4d4d' font-family='monospace, sans-serif' font-size='14' font-weight='bold'%3E老妹管教计划制定中...%3Canimate attributeName='opacity' values='1;0.2;1' dur='2s' repeatCount='indefinite' /%3E%3C/text%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    z-index: 10 !important;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block {
        max-width: 95% !important;
    }
    .flex.items-center.justify-center.w-6.h-5 {
        min-width: 160px !important;
    }
}
/* --- 顶部栏美化：威严黑与叛逆粉 --- */
.sticky.w-full.top-0.flex.items-center {
    background-color: #0a0a0a !important;
    border-bottom: 2px solid #ff3377 !important;
    box-shadow: 0 4px 15px rgba(255, 51, 119, 0.3) !important;
}

/* 模型选择器美化 */
#ai-model-selector .group.flex.items-center {
    background: rgba(255, 51, 119, 0.1) !important;
    border: 1px solid #ff3377 !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
}

#ai-model-selector .truncate.text-\[13px\] {
    color: #ff3377 !important;
    font-weight: bold !important;
    font-family: "Microsoft YaHei", sans-serif !important;
}

#ai-model-selector .shrink-0.flex.items-center svg {
    color: #ff3377 !important;
}

/* 顶部图标颜色修正 */
.sticky.w-full.top-0 svg.lucide-clock-8,
.sticky.w-full.top-0 svg:has(use[href="#icon-icon-set"]),
#header-setting-button svg {
    color: #ff3377 !important;
    filter: drop-shadow(0 0 2px #ff3377) !important;
}

/* --- 开场白选择器 --- */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
    background-color: #1a1a1a !important;
    border: 1px solid #ff3377 !important;
    color: #ff3377 !important;
}

div.flex.items-center.h-9.cursor-pointer.group svg {
    color: #ff3377 !important;
}

/* --- 按钮栏：霓虹效果 --- */
#ai-mod-button2 button.MuiButton-root {
    background-color: #000000 !important;
    color: #ff3377 !important;
    border: 1px solid #ff3377 !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    transition: all 0.2s !important;
}

#ai-mod-button2 button.MuiButton-root:hover {
    background-color: #ff3377 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px #ff3377 !important;
}

/* --- 底部输入栏 --- */
.bg-gradient-to-t {
    background: linear-gradient(to top, #0a0a0a, transparent) !important;
}

#ai-chat-bottom-input {
    background-color: #1a1a1a !important;
    border: 2px solid #ff3377 !important;
    border-radius: 12px !important;
    box-shadow: 0 -2px 10px rgba(255, 51, 119, 0.2) !important;
}

#ai-chat-input {
    color: #ffffff !important;
    caret-color: #ff3377 !important;
}

#ai-chat-input::placeholder {
    color: rgba(255, 51, 119, 0.5) !important;
}

#ai-chat-input::selection {
    background-color: #ff3377 !important;
    color: #ffffff !important;
}

/* --- 分页栏样式 --- */
.MuiPaginationItem-root {
    color: #ff3377 !important;
    border: 1px solid rgba(255, 51, 119, 0.3) !important;
}

.MuiPaginationItem-root.Mui-selected {
    background-color: #ff3377 !important;
    color: #ffffff !important;
}

.MuiInputBase-input {
    color: #ff3377 !important;
}

/* --- 评论区：沉浸式暗黑风格 --- */
/* 主背景强制覆盖 */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background-color: #0f0f0f !important;
    border-top: 1px solid #ff3377 !important;
}

/* 评论区文字颜色修正（核心可读性） */
div.text-lg.font-bold, 
p.MuiTypography-body1.text-grey-600,
div.break-all,
div.text-sm.text-grey-600 span.font-bold,
span.text-orange-500 {
    color: #fce4ec !important; /* 浅粉色文字确保在黑底可见 */
}

/* 评分星星 */
span.MuiRating-iconFilled svg {
    color: #ff3377 !important;
}

/* 评论输入框 */
textarea.rc-textarea {
    background-color: #1a1a1a !important;
    border: 1px solid #ff3377 !important;
    color: #ffffff !important;
}

/* 排序按钮 */
button.MuiButton-containedPrimary {
    background-color: #ff3377 !important;
}

button.MuiButton-outlinedPrimary {
    border-color: #ff3377 !important;
    color: #ff3377 !important;
}

/* 发送按钮 */
div.cursor-pointer.group.flex.items-center.justify-center {
    background-color: #ff3377 !important;
    border-radius: 50% !important;
}

div[data-state="closed"] svg[data-icon="Send03"] {
    color: #ffffff !important;
}

/* 分割线 */
div.style_divider__mW0YX {
    background-color: rgba(255, 51, 119, 0.2) !important;
}

/* 回复区域边框 */
div.ml-8.border-l {
    border-left: 2px solid #ff3377 !important;
}

/* 用户头像描边 */
div.group img.rounded-full {
    border: 2px solid #ff3377 !important;
}