/* =========================================
   【伟大之路】硬核体育杂志风聊天框美化
   ========================================= */

/* 1. 强制隐藏系统默认的粉色/蓝色顶部装饰条 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* 2. 聊天框主体框架 - 炭黑底色，橙色硬边，体育画报质感 */
.bg-gray-100\/90.relative.inline-block {
    background-color: #1A1A1D !important; /* 深邃炭黑底色 */
    border: 3px solid #FF5722 !important; /* 赛场橙色粗边框 */
    border-radius: 4px !important; /* 微小圆角，保持硬朗 */
    box-shadow: 6px 6px 0px #FF5722 !important; /* 杂志风硬阴影 */
    padding: 16px !important;
    margin: 12px 0 16px 0 !important;
    position: relative !important;
    overflow: hidden !important; /* 确保内部动效不溢出 */
    isolation: isolate !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-image: repeating-linear-gradient(45deg, rgba(255, 87, 34, 0.03) 0px, rgba(255, 87, 34, 0.03) 2px, transparent 2px, transparent 8px) !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* 3. 核心文本区 - 绝对可读性保障 (深底浅字，严禁阴影) */
.markdown-body {
    background: transparent !important;
    color: #F0F0F0 !important; /* 高对比度亮灰色，比纯白更护眼 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: bold !important; /* 全局加粗，力量感 */
    text-shadow: none !important; /* 绝对禁止文字阴影影响阅读 */
    position: relative !important;
    z-index: 1 !important;
    line-height: 1.6 !important;
}

/* 4. 底部附加元素 - 赛场黄高亮，与主文本区分 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #FFD600 !important; /* 赛场明黄，在深色背景上极度清晰 */
    font-weight: bold !important;
    position: relative !important;
    z-index: 1 !important;
    transition: all 0.2s ease !important;
}
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    color: #FFFFFF !important;
    background: rgba(255, 87, 34, 0.3) !important;
}

/* =========================================
   5. 巨型沉浸式加载动画 (SVG + 画布 + 进度条)
   ========================================= */

/* 隐藏默认的无聊闪烁圆点 */
.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: 280px !important;
    height: 380px !important; /* 极大的展示空间 */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: #111111 !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
    overflow: hidden !important;
}

/* 伪元素 ::before - 承载指定图片、伪进度条与提示文字 */
.flex.items-center.justify-center.w-6.h-5::before {
    content: "建议2到4游玩记忆，下方有快捷键，按需使用。" !important;
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    
    /* 多重背景：层1=动态进度条(橙黄), 层2=进度条轨道(深灰), 层3=用户指定原图 */
    background-image: 
        linear-gradient(90deg, #FFD600 0%, #FF5722 100%),
        linear-gradient(90deg, #333333 0%, #333333 100%),
        url('https://catai.wiki/84a3d322-d5f9-4356-f152-4b52ce77cf00/w=3000') !important;
    
    /* 尺寸：进度条高度8px，图片保持contain原比例 */
    background-size: 
        0% 8px, 
        80% 8px, 
        contain !important;
        
    /* 位置：进度条在底部上方30px处，图片居中偏上 */
    background-position: 
        center calc(100% - 35px),
        center calc(100% - 35px),
        center 10px !important;
    background-repeat: no-repeat !important;
    
    /* 文字排版 */
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    padding-bottom: 10px !important;
    color: #FFFFFF !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: 1px !important;
    text-shadow: 2px 2px 4px #000000, -1px -1px 2px #000000 !important; /* 确保文字在任何图片背景上可见 */
    z-index: 10 !important;
    
    /* 触发进度条动画 */
    animation: fakeProgressBar 2.5s ease-in-out infinite !important;
}

/* 伪元素 ::after - 旋转的SVG篮球 (SMIL内联动画，抗屏蔽) */
.flex.items-center.justify-center.w-6.h-5::after {
    content: "" !important;
    position: absolute !important;
    top: 45% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80px !important;
    height: 80px !important;
    /* 注入纯血SVG篮球，自带SMIL rotate动画 */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g><circle cx="50" cy="50" r="46" fill="%23FF5722" stroke="%231A1A1D" stroke-width="5"/><path d="M50 4 v92 M4 50 h92 M17 17 Q50 50 83 83 M17 83 Q50 50 83 17" fill="none" stroke="%231A1A1D" stroke-width="4"/><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" dur="1.2s" repeatCount="indefinite"/></g></svg>') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    z-index: 11 !important;
    opacity: 0.85 !important;
    filter: drop-shadow(0px 10px 10px rgba(0,0,0,0.5)) !important;
}

/* CSS关键帧：驱动进度条的宽度变化 */
@keyframes fakeProgressBar {
    0% { background-size: 0% 8px, 80% 8px, contain; }
    40% { background-size: 50% 8px, 80% 8px, contain; }
    80% { background-size: 75% 8px, 80% 8px, contain; }
    100% { background-size: 80% 8px, 80% 8px, contain; }
}

/* 移动端微调适配 */
@media (max-width: 480px) {
    .flex.items-center.justify-center.w-6.h-5 {
        height: 280px !important;
    }
    .flex.items-center.justify-center.w-6.h-5::after {
        width: 60px !important;
        height: 60px !important;
    }
    .flex.items-center.justify-center.w-6.h-5::before {
        font-size: 11px !important;
        background-position: center calc(100% - 25px), center calc(100% - 25px), center 5px !important;
    }
}

ai {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #F4ECE6;
    background-image: repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 8px);
    color: #1A1A24;
    font-size: 14px;
    padding: 10px;
    line-height: 1.5;
    
    /* 核心色彩变量 */
    --c-orange: #FF5722;
    --c-orange-dark: #E64A19;
    --c-dark: #111111;
    --c-blue: #2962FF;
    --c-red: #D50000;
    --c-yellow: #FFD600;
    --c-bg: #FFFFFF;
}

/* 基础折叠面板与标题 - 杂志体育风 */
ai details {
    background: var(--c-bg);
    border: 2px solid var(--c-dark);
    box-shadow: 4px 4px 0px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

ai summary {
    background: var(--c-dark);
    color: #fff;
    padding: 12px 15px;
    font-size: 15px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 1px;
    list-style: none;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #000;
}
ai summary::-webkit-details-marker { display: none; }
ai summary:active { transform: scale(0.98); }

/* 各模块独立配色与风格化 */
ai .mode summary { 
    background: var(--c-yellow); 
    color: var(--c-dark); 
    border-bottom: 4px solid var(--c-dark);
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(0,0,0,0.1) 10px, rgba(0,0,0,0.1) 20px);
}
ai .nw summary { background: linear-gradient(90deg, var(--c-red), #B71C1C); }
ai .env summary { background: #1B5E20; color: #00FF00; font-family: 'Courier New', Courier, monospace; text-shadow: 0 0 5px #00FF00; }
ai .p1 summary { background: linear-gradient(135deg, var(--c-orange), var(--c-orange-dark)); }
ai .task summary { background: var(--c-blue); }
ai .p2 summary { background: #212121; border-left: 8px solid var(--c-red); }
ai .mem summary { background: #5D4037; }
ai .act summary { background: var(--c-dark); border-top: 3px dashed var(--c-yellow); }

/* 正文区域 - 纪实文学质感 */
ai txt {
    display: block;
    background: #fff;
    padding: 18px;
    font-size: 15.5px;
    line-height: 1.75;
    border-left: 5px solid var(--c-orange);
    box-shadow: inset 0 0 30px rgba(255, 87, 34, 0.03);
    color: #2c2c2c;
    border-radius: 2px;
}

/* 网格与数据条目 - 球员面板感 */
ai g { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
    gap: 8px; 
    padding: 12px; 
}
ai d { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-size: 13px; 
    background: #F8F9FA; 
    padding: 8px 10px; 
    border-radius: 4px; 
    border-left: 4px solid #CFD8DC;
    transition: background 0.2s;
}
ai d:hover { background: #EEEEEE; }
ai d.fw { grid-column: 1 / -1; }
ai f { font-weight: 900; color: var(--c-orange); margin-right: 8px; flex-shrink: 0; }
ai b { font-weight: 900; color: var(--c-dark); }

/* 盒子区域 - 战术板与面板 */
ai .bx { 
    background: #FAFAFA; 
    border: 1px solid #E0E0E0; 
    margin: 10px 12px; 
    padding: 12px; 
    border-radius: 6px; 
    position: relative; 
    box-shadow: 2px 2px 0px rgba(0,0,0,0.05);
}
ai .bx::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; 
    width: 6px; height: 100%; 
    background: var(--c-blue); 
    border-radius: 6px 0 0 6px;
}
ai .p1 .bx::before { background: var(--c-orange); }
ai .task .bx::before { background: var(--c-yellow); }
ai .bx li { 
    font-size: 13.5px; 
    margin-bottom: 6px; 
    padding-left: 5px; 
    list-style-type: square; 
    color: #333; 
    line-height: 1.4;
}

/* 社交媒体快讯特化 */
ai .nw d { flex-direction: column; align-items: flex-start; border-left-color: var(--c-red); gap: 4px; }
ai .nw f { animation: pulse 2s infinite; color: var(--c-red); }
ai .nw span { color: #555; font-style: italic; font-size: 12.5px; }

/* 场地环境特化 - 电子记分牌风格 */
ai .env g { background: #111; padding: 10px; border-radius: 0 0 4px 4px; }
ai .env d { background: #222; color: #4CAF50; border: 1px solid #333; border-left: none; box-shadow: inset 0 0 8px rgba(76, 175, 80, 0.2); }
ai .env b { color: #81C784; }

/* 记忆区特化 */
ai mr { display: block; background: #FFF3E0; color: #E65100; padding: 8px; font-size: 12px; font-weight: bold; border-bottom: 2px dashed #FFB74D; margin-bottom: 10px; }
ai .sm summary { background: #EFEBE9; color: #4E342E; font-size: 14px; border-bottom: none; border-left: 4px solid #795548; font-style: normal; }
ai .mem p { padding: 10px; font-size: 13px; color: #555; background: #fff; margin: 0; }

/* 行动抉择 - Galgame/体育游戏按键风 */
ai .act ol { padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; background: #222; }
ai .act li { 
    background: #333; 
    color: #fff; 
    padding: 12px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-weight: bold; 
    border-left: 5px solid transparent; 
    list-style-position: inside;
}
ai .act li:hover { 
    background: var(--c-orange); 
    border-left: 5px solid var(--c-yellow); 
    transform: translateX(6px); 
    box-shadow: 0 4px 8px rgba(255, 87, 34, 0.4);
    color: #fff;
}

/* 动效 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}