/* HYPER-POP GLITCH UI - v4.0 [ULTIMATE ANIMATION EDITION] */
/* 核心增强：动态扫描线、红蓝文本故障、机械点击反馈、霓虹呼吸 */

/* --- 1. 舞台背景与全局容器 --- */
ai {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    background-image:
        radial-gradient(#222 1px, transparent 0),
        repeating-linear-gradient(45deg, rgba(255,0,85,0.03) 0, rgba(255,0,85,0.03) 1px, transparent 0, transparent 50%);
    background-size: 10px 10px, 20px 20px;
    color: #fff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    padding: 15px;
    border: 4px solid #fff;
    box-shadow: 8px 8px 0px #ff0055, -5px -5px 0px #00f3ff;
    position: relative;
    margin: 25px 5px 15px 5px;
    overflow: hidden; /* 限制扫描线溢出 */
}

/* 屏幕噪点与动态扫描线 (新增动画) */
ai::after {
    content: "";
    position: absolute;
    inset: -100% 0; /* 扩大范围以支持滚动 */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
    z-index: 10;
    animation: scanline 10s linear infinite;
}

/* --- 2. 顶部导航 --- */
ai hd {
    order: -2;
    display: block;
    background: #fcee0a;
    color: #000;
    padding: 8px 15px;
    margin: -30px -5px 15px 10px;
    transform: skewX(-15deg);
    border: 3px solid #000;
    box-shadow: 5px 5px 0px #ff0055;
    position: relative;
    z-index: 11;
    transition: 0.3s;
}
ai hd:hover {
    box-shadow: 8px 8px 0px #00f3ff;
    transform: skewX(-15deg) translateY(-2px);
}
ai hd f { 
    font-family: 'Impact', 'Arial Black', sans-serif;
    color: #ff0055; 
    text-shadow: none; 
    font-size: 15px; 
    margin-right: 4px;
}
ai hd d { 
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 900;
    font-size: 14px;
    color: #000;
    margin-right: 12px;
}

/* --- 3. 正文内容区 (新增霓虹呼吸边框) --- */
ai article {
    order: -1;
    display: block;
    background: rgba(0, 243, 255, 0.05);
    border-left: 6px solid #00f3ff;
    padding: 15px;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 15px;
    position: relative;
    clip-path: polygon(0% 0%, 100% 0%, 100% 95%, 95% 100%, 0% 100%);
    z-index: 11;
    text-shadow: 0 0 1px rgba(255,255,255,0.2);
    animation: border-flicker 4s infinite alternate;
}

ai strong {
    background: #fcee0a;
    color: #000;
    padding: 0 5px;
    font-style: italic;
    box-shadow: 3px 3px 0px #ff0055;
}

/* --- 4. 详情区块 (折叠面板) --- */
ai details {
    margin-bottom: 15px;
    border: 2px solid #fff;
    background: #000;
    box-shadow: 4px 4px 0px rgba(255,255,255,0.2);
    position: relative;
    z-index: 11;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

ai summary {
    padding: 10px 15px;
    background: #111;
    color: #00f3ff;
    cursor: pointer;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    border-bottom: 2px solid #333;
    display: flex;
    justify-content: space-between;
    transition: 0.2s;
    user-select: none;
}
ai summary::-webkit-details-marker { display: none; }

/* 悬停动效：红蓝故障文字 */
ai summary:hover {
    background: #1a1a1a;
    animation: text-glitch 0.3s infinite;
}

/* 点击反馈：机械下压 */
ai summary:active {
    background: #ff0055;
    color: #fff;
}
ai details:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(255,255,255,0.5);
}

ai details[open] summary {
    background: #00f3ff;
    color: #000;
    animation: glitch-skew 3s infinite;
    border-bottom: none;
}
ai details[open] {
    background-image: radial-gradient(#ff0055 15%, transparent 15%);
    background-size: 8px 8px;
    padding-bottom: 10px;
}
/* 展开状态下的点击反馈 */
ai details[open]:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px transparent;
}

/* --- 5. 分组与标题 --- */
ai g {
    display: block;
    background: #0a0a0a;
    border: 1px solid #333;
    margin: 15px 10px 10px 10px;
    padding: 18px 10px 8px 10px;
    position: relative;
    transition: 0.3s;
}
ai g:hover {
    border-color: #555;
    background: #0f0f0f;
}
ai t {
    position: absolute;
    top: -12px;
    left: 10px;
    background: #fcee0a;
    color: #000;
    padding: 2px 12px;
    transform: skewX(-15deg);
    border: 2px solid #000;
    box-shadow: 4px 4px 0px #ff0055;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 15px;
    text-transform: uppercase;
}

/* --- 6. 极致字体排版 --- */
ai p {
    display: flex;
    align-items: baseline;
    margin: 8px 5px;
    border-bottom: 1px dashed #222;
    padding-bottom: 4px;
}
ai f {
    font-family: 'Impact', 'Arial Black', sans-serif;
    color: #fcee0a;
    text-shadow: 2px 2px 0px #ff0055;
    font-size: 14px;
    letter-spacing: 0.5px;
    margin-right: 8px;
    white-space: nowrap;
}
ai v {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #e2e8f0;
    font-size: 13.5px;
    text-shadow: 0 0 4px rgba(0, 243, 255, 0.4);
    line-height: 1.4;
}

/* --- 7. 动态刻度条 --- */
ai p[t="VAL"] {
    background: #111;
    border: 1px solid #444;
    padding: 8px;
    margin: 8px 5px;
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: center;
    border-bottom: none;
}
ai u {
    height: 14px;
    background: #222;
    position: relative;
    border: 1px solid #fcee0a;
    overflow: hidden;
    display: block;
}
ai u::after {
    content: "";
    position: absolute;
    left: 0; top: 0; height: 100%;
    width: var(--w, 50%);
    background: repeating-linear-gradient(90deg, #ff0055 0px, #ff0055 8px, transparent 8px, transparent 10px);
    box-shadow: 0 0 15px #ff0055;
    animation: pulse 1.5s infinite;
}

/* --- 8. 交互式行动推荐 (强化动效) --- */
ai q {
    display: block;
    background: #000;
    border: 3px solid #fcee0a;
    padding: 10px 12px;
    margin: 10px;
    color: #fcee0a;
    font-family: 'Impact', sans-serif;
    font-size: 15px;
    clip-path: polygon(2% 0%, 100% 0%, 98% 100%, 0% 100%);
    transition: all 0.15s ease-out;
    cursor: pointer;
    user-select: none;
}
/* 悬停：错位拉扯与文字故障 */
ai q:hover {
    background: #fcee0a;
    color: #000;
    transform: scale(1.02) skewX(-4deg);
    box-shadow: 8px 0px 0px #00f3ff, -8px 0px 0px #ff0055;
    animation: text-glitch 0.2s infinite;
}
/* 点击：强烈的物理回弹 */
ai q:active {
    transform: scale(0.98) translate(4px, 4px) skewX(-2deg);
    box-shadow: 2px 0px 0px #00f3ff, -2px 0px 0px #ff0055;
    background: #ff0055;
    color: #fff;
    border-color: #ff0055;
}
ai q f {
    color: #00f3ff;
    text-shadow: none;
    background: #222;
    padding: 2px 6px;
    border: 1px solid #00f3ff;
    transition: 0.2s;
}
ai q:hover f { background: #000; color: #fcee0a; border-color: #000; }
ai q:active f { background: #fff; color: #ff0055; }

/* --- 9. 终极动画库 --- */
/* 面板展开时的间歇性抽搐 */
@keyframes glitch-skew {
    0%, 19%, 22%, 100% { transform: skew(0deg); filter: none; }
    20% { transform: skew(4deg) translate(-2px, 1px); filter: hue-rotate(90deg); }
    21% { transform: skew(-4deg) translate(2px, -1px); filter: invert(0.2); }
}
/* 进度条脉冲 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
/* 全屏扫描线滚动 */
@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(50%); }
}
/* 文本高频红蓝故障 */
@keyframes text-glitch {
    0% { text-shadow: 2px 0 #ff0055, -2px 0 #00f3ff; }
    25% { text-shadow: -2px 0 #ff0055, 2px 0 #00f3ff; }
    50% { text-shadow: 2px 0 #00f3ff, -2px 0 #ff0055; }
    75% { text-shadow: -2px 0 #00f3ff, 2px 0 #ff0055; }
    100% { text-shadow: 2px 0 #ff0055, -2px 0 #00f3ff; }
}
/* 边框霓虹呼吸 */
@keyframes border-flicker {
    0%, 48%, 52%, 100% { 
        border-left-color: #00f3ff; 
        box-shadow: -5px 0 15px rgba(0,243,255,0.1); 
    }
    50% { 
        border-left-color: #ff0055; 
        box-shadow: -5px 0 25px rgba(255,0,85,0.4); 
    }
}
/* HYPER-POP GLITCH UI - 平台聊天框全局美化 */
/* 核心：绝对可读性、波普网点、红蓝错位阴影、硬核终端字体 */

/* --- 1. 隐藏平台默认的顶部颜色装饰条 --- */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* --- 2. 统一聊天框基础底板 (AI输出框默认样式) --- */
.bg-gray-100\/90.relative.inline-block {
    background-color: #0a0a0a !important;
    /* 波普网点与极弱扫描线底纹 */
    background-image:
        radial-gradient(#222 1px, transparent 0),
        repeating-linear-gradient(45deg, rgba(255,0,85,0.03) 0, rgba(255,0,85,0.03) 1px, transparent 0, transparent 50%) !important;
    background-size: 10px 10px, 20px 20px !important;
    border: 2px solid #00f3ff !important;
    /* 核心视觉：红蓝错位硬阴影 */
    box-shadow: 6px 6px 0px #ff0055, -4px -4px 0px #00f3ff !important;
    border-radius: 0px !important; /* 强制直角，机械感 */
    padding: 15px 20px !important;
    isolation: isolate !important;
    transition: all 0.3s ease !important;
}

/* --- 3. 玩家输入聊天框 (视觉差异化：洋红主导) --- */
.bg-gray-100\/90.relative.inline-block:not(.chat-answer-container .bg-gray-100\/90) {
    border-color: #ff0055 !important;
    background-color: #110005 !important;
    box-shadow: 6px 6px 0px #00f3ff, -4px -4px 0px #fcee0a !important;
}

/* --- 4. 聊天框主要文本 (最高原则：绝对可读) --- */
.markdown-body {
    color: #F0F0F0 !important; /* 深色背景必须配高亮度文字 */
    font-family: 'Segoe UI', system-ui, sans-serif !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    text-shadow: none !important; /* 严禁文字阴影干扰阅读 */
    background: transparent !important;
    z-index: 1 !important;
}

/* 拦截 Markdown 加粗：波普记号笔风格 */
.markdown-body strong {
    background: #fcee0a !important;
    color: #000 !important;
    padding: 0 4px !important;
    font-style: italic !important;
    box-shadow: 2px 2px 0px #ff0055 !important;
    font-weight: 900 !important;
}

/* 拦截 Markdown 代码块：黑客终端风格 */
.markdown-body code {
    background: #111 !important;
    color: #00f3ff !important;
    border: 1px solid #ff0055 !important;
    border-radius: 0 !important;
    padding: 2px 5px !important;
    font-family: 'Consolas', monospace !important;
}

/* --- 5. 底部附加元素 (按钮、模型名称、Token消耗) --- */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2,
.text-orange-500 {
    color: #e2e8f0 !important; /* 高对比浅灰色，确保可见 */
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-weight: bold !important;
    text-shadow: none !important;
    transition: 0.2s !important;
}

/* 底部操作按钮悬停特效 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    background: #fcee0a !important;
    color: #000 !important;
    box-shadow: 2px 2px 0px #ff0055 !important;
    transform: translate(-1px, -1px) !important;
    border-radius: 0 !important;
}

/* --- 6. 极致动效：故障风加载动画 (纯SVG SMIL驱动) --- */
/* 隐藏平台默认的加载点 */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important;
}

/* 设置加载容器 */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: 30px !important;
}

/* 注入红蓝数据块高频交替闪烁动画 */
.flex.items-center.justify-center.w-6.h-5::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="20" viewBox="0 0 30 20"><rect x="2" y="5" width="8" height="10" fill="%23ff0055"><animate attributeName="y" values="5;3;7;5" dur="0.15s" repeatCount="indefinite"/><animate attributeName="opacity" values="1;0;1" dur="0.3s" repeatCount="indefinite"/></rect><rect x="14" y="5" width="8" height="10" fill="%2300f3ff"><animate attributeName="y" values="5;7;3;5" dur="0.15s" repeatCount="indefinite"/><animate attributeName="opacity" values="0;1;0" dur="0.3s" repeatCount="indefinite"/></rect></svg>') !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}
/* HYPER-POP GLITCH UI - 平台全局界面美化 */
/* 核心：高对比度、无圆角几何、红蓝硬阴影、深色终端化 */

/* ==========================================
   1. 顶部栏 (Top Bar)
   ========================================== */
/* 顶部容器背景与底纹 */
.sticky.w-full.top-0.flex.items-center {
    background-color: #0a0a0a !important;
    background-image: radial-gradient(#222 1px, transparent 0) !important;
    background-size: 10px 10px !important;
    border-bottom: 3px solid #00f3ff !important;
    box-shadow: 0px 4px 0px rgba(0, 243, 255, 0.2) !important;
}

/* 模型选择器按钮 (高亮波普风) */
#ai-model-selector .group.flex.items-center {
    background: #fcee0a !important;
    border: 2px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: 3px 3px 0px #ff0055 !important;
    transition: all 0.2s ease !important;
}
#ai-model-selector .group.flex.items-center:hover {
    background: #ff0055 !important;
    box-shadow: 3px 3px 0px #00f3ff !important;
    transform: translate(-1px, -1px) !important;
}
/* 模型文字 */
#ai-model-selector .truncate.text-\[13px\] {
    font-family: 'Impact', 'Arial Black', sans-serif !important;
    color: #000 !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
}
#ai-model-selector .group.flex.items-center:hover .truncate.text-\[13px\] {
    color: #fff !important;
}

/* 顶部栏图标 (SVG变色与阴影) */
.sticky.w-full.top-0 svg, #header-setting-button svg {
    color: #00f3ff !important;
    filter: drop-shadow(2px 2px 0px #ff0055) !important;
    transition: 0.2s !important;
}
.sticky.w-full.top-0 button:hover svg, #header-setting-button:hover svg {
    color: #fcee0a !important;
    filter: drop-shadow(2px 2px 0px #000) !important;
}

/* ==========================================
   2. 开场白选择器 (Selector)
   ========================================== */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"],
div.h-9.rounded-md.cursor-pointer.group:has(svg[data-icon="SlidersH"]) {
    background-color: #111 !important;
    border: 2px solid #00f3ff !important;
    border-radius: 0 !important;
    color: #00f3ff !important;
    box-shadow: 3px 3px 0px #ff0055 !important;
    transition: 0.2s !important;
}
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"]:hover {
    background-color: #00f3ff !important;
    color: #000 !important;
    box-shadow: 3px 3px 0px #000 !important;
}

/* ==========================================
   3. 按钮栏 (Action Buttons)
   ========================================== */
#ai-mod-button2 button.MuiButton-root {
    background: #0a0a0a !important;
    border: 2px solid #fcee0a !important;
    border-radius: 0 !important;
    color: #fcee0a !important;
    font-family: 'Impact', sans-serif !important;
    font-size: 14px !important;
    box-shadow: 4px 4px 0px #ff0055 !important;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
}
#ai-mod-button2 button.MuiButton-root:hover {
    background: #fcee0a !important;
    color: #000 !important;
    box-shadow: 6px 6px 0px #00f3ff !important;
    transform: translate(-2px, -2px) !important;
}
/* 机械下压点击感 */
#ai-mod-button2 button.MuiButton-root:active {
    transform: translate(2px, 2px) !important;
    box-shadow: 0px 0px 0px transparent !important;
    background: #ff0055 !important;
    border-color: #ff0055 !important;
    color: #fff !important;
}

/* ==========================================
   4. 底部输入栏 (Bottom Input)
   ========================================== */
/* 消除默认白雾渐变，改为赛博黑幕 */
.bg-gradient-to-t {
    background: linear-gradient(to top, #000 70%, transparent 100%) !important;
}

/* 输入框本体 */
#ai-chat-input {
    background-color: #0a0a0a !important;
    border: 2px solid #ff0055 !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-size: 15px !important;
    box-shadow: 0 0 10px rgba(255,0,85,0.2), inset 0 0 5px rgba(255,0,85,0.2) !important;
    transition: 0.3s !important;
}
#ai-chat-input:focus {
    border-color: #00f3ff !important;
    box-shadow: 0 0 15px rgba(0,243,255,0.4), inset 0 0 8px rgba(0,243,255,0.2) !important;
    outline: none !important;
}
#ai-chat-input::placeholder {
    color: rgba(0, 243, 255, 0.4) !important;
}
#ai-chat-input::selection {
    background: #fcee0a !important;
    color: #000 !important;
}

/* ==========================================
   5. 分页栏 (Pagination - 纯视觉重绘)
   ========================================== */
.MuiPaginationItem-root {
    border-radius: 0 !important;
    color: #00f3ff !important;
    font-family: 'Consolas', monospace !important;
    font-weight: bold !important;
    border: 1px solid transparent !important;
}
.MuiPaginationItem-root:hover {
    background-color: rgba(0, 243, 255, 0.1) !important;
    border: 1px solid #00f3ff !important;
}
/* 选中状态 */
.MuiPaginationItem-root.Mui-selected {
    background-color: #ff0055 !important;
    color: #fff !important;
    border: 1px solid #ff0055 !important;
    box-shadow: 2px 2px 0px #00f3ff !important;
}
/* 跳转输入区 */
.MuiInputBase-input {
    background: #111 !important;
    color: #fff !important;
    border: 1px solid #00f3ff !important;
    border-radius: 0 !important;
}

/* ==========================================
   6. 评论区 (Comments Section - 黑客终端化)
   ========================================== */
/* 评论区主背景 */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background-color: #0a0a0a !important;
    background-image: repeating-linear-gradient(45deg, rgba(255,0,85,0.02) 0, rgba(255,0,85,0.02) 1px, transparent 0, transparent 50%) !important;
    background-size: 20px 20px !important;
    border-top: 3px solid #ff0055 !important;
}

/* 强制文字反白 (绝对可读性保障) */
div.text-lg.font-bold, 
div.text-sm.text-grey-600 span.font-bold, 
div.break-all {
    color: #F0F0F0 !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
}
/* 次要文字 (时间、评分提示) */
p.MuiTypography-body1.text-grey-600, 
div.text-xs.text-grey-600, 
div.bg-gray-100.text-gray-500 {
    color: #00f3ff !important;
    opacity: 0.8 !important;
    background-color: transparent !important; /* 清除默认灰底 */
}

/* 评论输入框 */
textarea.rc-textarea {
    background-color: #111 !important;
    border: 2px solid #00f3ff !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-family: 'Consolas', monospace !important;
}
textarea.rc-textarea:focus {
    border-color: #fcee0a !important;
    box-shadow: 4px 4px 0px #ff0055 !important;
}

/* 发送评论按钮 */
div.cursor-pointer.group.flex.items-center.justify-center {
    background: #fcee0a !important;
    border-radius: 0 !important;
    border: 2px solid #000 !important;
    transition: 0.2s !important;
}
div.cursor-pointer.group.flex.items-center.justify-center:hover {
    background: #ff0055 !important;
}
div[data-state="closed"] svg[data-icon="Send03"] {
    color: #000 !important;
}
div.cursor-pointer.group.flex.items-center.justify-center:hover svg {
    color: #fff !important;
}

/* 排序按钮 */
button.MuiButton-containedPrimary {
    background: #ff0055 !important;
    border-radius: 0 !important;
    color: #fff !important;
    box-shadow: 2px 2px 0px #00f3ff !important;
}
button.MuiButton-outlinedPrimary {
    border: 2px solid #00f3ff !important;
    border-radius: 0 !important;
    color: #00f3ff !important;
}

/* 分割线与回复边框 */
div.style_divider__mW0YX {
    background-color: #333 !important;
    border-top: 1px dashed #ff0055 !important;
}
div.ml-8.border-l {
    border-left-color: #00f3ff !important;
}

/* 交互小按钮 (点赞、回复) */
button.text-gray-400 svg, span.cursor-pointer {
    color: #00f3ff !important;
    transition: 0.2s !important;
}
button.text-gray-400:hover svg, span.cursor-pointer:hover {
    color: #ff0055 !important;
    filter: drop-shadow(0 0 5px #ff0055) !important;
}