/* =========================================
   综艺剪贴报聊天框 & 巨型图片进度条加载动画
   ========================================= */

/* 1. 隐藏默认顶部颜色带子 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* 2. 统一聊天框美化：暖色综艺底纹与剪贴边框 */
.bg-gray-100\/90.relative.inline-block {
    background: linear-gradient(135deg, #fffcf9 0%, #fff0f5 100%) !important;
    border: 2px dashed #ffb6c1 !important;
    border-radius: 12px !important;
    box-shadow: 4px 4px 0px rgba(255, 182, 193, 0.5) !important;
    isolation: isolate !important; /* 创建层叠上下文，隔离背景动效 */
    overflow: hidden !important;
    padding: 15px !important; /* 增加内边距让内容更呼吸 */
}

/* 聊天框背景装饰：复古电视微弱扫描线 */
.bg-gray-100\/90.relative.inline-block::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 118, 117, 0.03) 2px, rgba(255, 118, 117, 0.03) 4px) !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* 3. 核心文本可读性保障 (浅色背景 + 深色高对比文字) */
.markdown-body {
    color: #2d3436 !important; /* 极深灰，比纯黑柔和但对比度极高 */
    font-weight: bold !important;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
    text-shadow: none !important; /* 严禁文字阴影，保证绝对清晰 */
    background: transparent !important;
    z-index: 1 !important;
    position: relative !important;
}

/* 4. 底部附加元素美化 (按钮、模型名、Token) */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #636e72 !important; /* 深灰色，与主文本略有区分 */
    font-weight: bold !important;
    text-shadow: none !important;
}

/* =========================================
   5. 巨型定制加载动画 & 伪进度条
   ========================================= */

/* 隐藏默认的点点点加载动画 */
.style-module__AtdJSq__dot-flashing.style-module__AtdJSq__text {
    display: none !important;
}

/* 扩大加载容器，为巨型图片和进度条腾出空间 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: 100% !important; /* 占满聊天框宽度 */
    min-width: 250px !important;
    height: 220px !important; /* 足够的高度容纳图片和进度条 */
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    margin: 10px 0 !important;
}

/* ::before 构建巨型居中图片 (带有呼吸悬浮动效) */
.flex.items-center.justify-center.w-6.h-5::before {
    content: "" !important;
    display: block !important;
    width: 160px !important; /* 控制图片显示尺寸，保持巨大但不撑爆屏幕 */
    height: 160px !important;
    background-image: url('https://catai.wiki/b21b8f42-cb02-4520-6f8f-2656687e7700/w=3000') !important;
    background-size: contain !important; /* 保持原比例 */
    background-position: center !important;
    background-repeat: no-repeat !important;
    animation: loadingFloat 2s ease-in-out infinite alternate !important;
    margin-bottom: 15px !important; /* 与下方进度条保持间距 */
    filter: drop-shadow(2px 4px 6px rgba(255, 118, 117, 0.3)) !important; /* 增加图片的综艺贴纸感 */
}

/* ::after 构建复古综艺风条纹伪进度条 */
.flex.items-center.justify-center.w-6.h-5::after {
    content: "LOADING..." !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 220px !important; /* 进度条宽度 */
    height: 18px !important;
    /* 暖色斜向条纹渐变 */
    background: repeating-linear-gradient(
        45deg,
        #ff7675,
        #ff7675 12px,
        #ffb6c1 12px,
        #ffb6c1 24px
    ) !important;
    background-size: 48px 18px !important;
    border: 2px solid #2d3436 !important; /* 黑色粗边框增加漫画感 */
    border-radius: 10px !important;
    color: #2d3436 !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    text-shadow: 1px 1px 0px #fff !important; /* 文字白色描边使其在花哨背景上清晰 */
    box-shadow: 3px 3px 0px rgba(0,0,0,0.15) !important;
    animation: progressScroll 1s linear infinite !important; /* 条纹滚动动效 */
}

/* 动效关键帧 (即使设备禁用动画，图片和进度条底图依然会静态居中展示) */
@keyframes loadingFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

@keyframes progressScroll {
    0% { background-position: 0 0; }
    100% { background-position: 48px 0; }
}

/* 移动端微调：防止进度条过长 */
@media (max-width: 480px) {
    .flex.items-center.justify-center.w-6.h-5::after {
        width: 180px !important;
    }
}

/* =========================================
   男娘堂弟纯爱轻喜剧 - 综艺剪贴报UI
   ========================================= */

/* 1. 根容器：暖色摄影棚底色 + TV扫描线 */
c-ui {
    display: block;
    background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 50%, #ffefd5 100%);
    border: 3px solid #ffb6c1;
    border-radius: 12px;
    padding: 15px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #3e2723;
    box-shadow: 6px 6px 0px rgba(255, 182, 193, 0.5);
    position: relative;
    overflow: hidden;
    line-height: 1.5;
}
/* 电视扫描线滤镜 */
c-ui::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.02) 2px, rgba(0,0,0,0.04) 4px);
    pointer-events: none;
    z-index: 0;
}

/* 2. 隐藏系统思维链，保持界面整洁 */
c-ui .sys { display: none; }

/* 3. 头部：电影场记板风格 */
c-ui hd {
    display: flex;
    justify-content: space-between;
    background: #2d3436;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 18px;
    position: relative;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
    /* 场记板黑白条纹 */
    border-top: 10px solid;
    border-image: repeating-linear-gradient(45deg, #fff 0, #fff 12px, #2d3436 12px, #2d3436 24px) 10;
    z-index: 1;
}
c-ui hd t { font-weight: bold; color: #ffeaa7; letter-spacing: 1px; }
c-ui hd l { font-style: italic; color: #81ecec; font-size: 0.9em; }

/* 4. 通用折叠面板：剪贴报纸质感 */
c-ui details {
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    border-radius: 8px;
    border: 2px dashed #ff9a9e;
    box-shadow: 3px 3px 0px rgba(255, 154, 158, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}
/* 模拟胶带粘贴效果 */
c-ui details::before {
    content: "";
    position: absolute;
    top: -8px; left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 60px; height: 18px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
    z-index: 2;
    pointer-events: none;
}
c-ui summary {
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 100%);
    padding: 10px 15px;
    font-weight: bold;
    color: #c2185b;
    cursor: pointer;
    list-style: none;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.6);
    border-bottom: 2px solid #fff;
    border-radius: 6px 6px 0 0;
}
c-ui summary::-webkit-details-marker { display: none; }

/* 5. 剧本正文：高对比度纯净阅读区 */
c-ui txt {
    display: block;
    background: #fffcf9;
    padding: 18px;
    margin: 15px 0;
    border-left: 5px solid #ff7675;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.7;
    color: #2d3436;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.02), 2px 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* 6. 状态数据网格 (我的状态 & 堂弟状态) */
c-ui p {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px;
    margin: 0;
}
c-ui d {
    display: flex;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ffe4e1;
    overflow: hidden;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.03);
}
/* 标签名：Dymo打字机标签风格 */
c-ui f {
    background: #ff7675;
    color: #fff;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    white-space: nowrap;
    border-right: 1px solid #fff;
}
c-ui span {
    padding: 6px 8px;
    font-size: 13px;
    color: #444;
    display: flex;
    align-items: center;
    flex: 1;
}

/* 7. 新闻区 (.nw) - 娱乐周刊风格 */
c-ui .nw { transform: rotate(1deg); border-color: #fdcb6e; }
c-ui .nw summary { background: linear-gradient(90deg, #ffeaa7, #fdcb6e); color: #d35400; }
c-ui .nw f { background: #e17055; }

/* 8. 夜夜子私密小号 (.th) - 拍立得/社交软件风格 */
c-ui .th { 
    transform: rotate(-1deg); 
    border-color: #74b9ff; 
    background: #f1f8ff; 
}
c-ui .th summary { background: linear-gradient(90deg, #a29bfe, #74b9ff); color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.2); }
c-ui .th q {
    display: block;
    padding: 15px;
    font-size: 14px;
    color: #0984e3;
    font-weight: bold;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><text x="0" y="15" font-size="15" opacity="0.1">❤</text></svg>');
}
c-ui .th q b { color: #d63031; margin-right: 5px; font-size: 1.1em; }

/* 9. 好感度进度条 - 综艺心动值打分条 */
c-ui lv {
    display: block;
    padding: 12px 15px;
    background: #fff0f5;
    border-top: 2px dashed #ffb6c1;
}
c-ui .lv-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
c-ui .lv-info b { color: #e84393; font-size: 15px; }
c-ui .lv-info span { font-weight: bold; color: #d63031; background: #fff; padding: 2px 6px; border-radius: 4px; border: 1px solid #ffb6c1; }
c-ui .lv-info i { color: #636e72; font-size: 12px; flex: 1; text-align: right; margin-left: 10px; }
c-ui bar {
    display: block;
    height: 14px;
    background: #dfe6e9;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
c-ui bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--v, 0%);
    background: linear-gradient(90deg, #ff7675, #fd79a8, #e84393);
    border-radius: 7px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(232, 67, 147, 0.6);
}

/* 10. 记忆笔记 (.m) - 剧本大纲夹 */
c-ui .m summary { background: linear-gradient(90deg, #55efc4, #81ecec); color: #00b894; }
c-ui mr {
    display: block;
    padding: 10px 15px;
    background: #fff9c4;
    font-size: 12px;
    color: #f39c12;
    border-bottom: 2px solid #f1c40f;
    font-weight: bold;
}
c-ui .sm summary { background: #f1f2f6; color: #2d3436; font-size: 13px; border: none; box-shadow: none; padding: 8px 15px; }
c-ui .sm p { display: block; font-size: 13px; color: #636e72; padding: 10px 15px; }

/* 11. 命运分歧选项 (.o) - 综艺遥控器按钮 */
c-ui .o summary { background: linear-gradient(90deg, #6c5ce7, #a29bfe); color: #fff; }
c-ui .o p {
    display: block;
    background: #a29bfe;
    color: #fff;
    padding: 12px 18px;
    margin: 10px 15px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0px #6c5ce7;
    text-align: center;
}
c-ui .o p:hover {
    transform: translateY(4px);
    box-shadow: 0 0px 0px #6c5ce7;
    background: #6c5ce7;
}

/* 移动端细微调整 */
@media (max-width: 480px) {
    c-ui p { grid-template-columns: 1fr; }
    c-ui { padding: 10px; }
    c-ui hd { flex-direction: column; gap: 5px; align-items: center; }
}