/* 绯弹的亚里亚 - 武侦终端风格 CSS (Rili平台适配版) */
.butei-terminal {
    background-color: #121214; /* 枪铁黑背景 */
    color: #e0e0e0; /* 灰白文字 */
    font-family: 'Segoe UI', Roboto, Helvetica, sans-serif;
    border: 2px solid #8b0000; /* 亚里亚红边框 */
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.3);
    max-width: 100%;
    font-size: 14px;
    line-height: 1.6;
}

/* 模块标题 - 类似文件夹标签或战术HUD */
.butei-terminal summary {
    background: linear-gradient(90deg, #2c0000 0%, #000000 100%);
    color: #ffcccc;
    padding: 6px 10px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    border-left: 4px solid #ff0000; /* 鲜红指示条 */
    margin-bottom: 5px;
    list-style: none; /* 移除默认三角 */
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

/* 自定义展开图标 */
.butei-terminal summary::after {
    content: "▼";
    margin-left: auto;
    color: #8b0000;
    font-size: 0.8em;
    transition: transform 0.2s;
}
.butei-terminal details[open] summary::after {
    transform: rotate(180deg);
}

/* 内容区域 */
.butei-terminal .hud-content {
    background-color: #1a1a1a;
    border: 1px solid #333;
    padding: 8px;
    margin-bottom: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

/* --- 自定义语义标签样式 --- */

/* <name> 姓名 - 红色高亮，强调 */
.butei-terminal name {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 1.05em;
    text-shadow: 0 0 2px rgba(255, 0, 0, 0.4);
}

/* <SL> 实力/等级 - 金色，象征武侦等级 */
.butei-terminal SL {
    color: #ffd700;
    font-weight: bold;
    display: inline-block;
    min-width: 50px;
}

/* <info> 常规信息标签 - 浅蓝灰色，科技感 */
.butei-terminal info {
    color: #8faec9;
    font-weight: 600;
}

/* <abli> 能力/技能 - 绿色或紫色，区别于常规信息 */
.butei-terminal abli {
    color: #cd5c5c; /* 印度红，略带危险感 */
    font-family: monospace;
    background: rgba(100, 0, 0, 0.2);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.95em;
}

/* 周边角色的小区块 */
.butei-terminal .sub-block {
    border-left: 2px solid #555;
    padding-left: 8px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.02);
}

/* 去除默认列表样式 */
.butei-terminal ul, .butei-terminal ol {
    padding-left: 20px;
    margin: 5px 0;
}

/* 选项按钮 - 《绯弹的亚里亚》风格配色 */
.ygg-opts { 
    padding: 15px; 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    background: #1c1c1c; 
    border-radius: 12px;
    border: 2px solid #d50000;
}

.opt-btn {
    padding: 12px 20px; 
    background: #f5f5f5; 
    border: 1px solid #424242;
    color: #212121; 
    font-weight: bold; 
    font-size: 14px; 
    cursor: pointer;
    transition: 0.3s; 
    border-left: 5px solid #ff1744;
    border-radius: 8px;
}

.opt-btn:hover {
    background: #d50000; 
    color: #ffffff; 
    transform: translateX(5px);
    box-shadow: 0 0 15px rgba(213, 0, 0, 0.6);
    border-color: #d50000;
}

/* 响应式微调 */
@media (max-width: 600px) {
    .item-pop { width: 85vw; }
    .ygg-body { padding: 15px; font-size: 14px; }
}

/* =================================================================
   Hidan no Aria Theme: Tokyo Butei High School & Assault Dept.
   绯弹的亚里亚主题：东京武侦高中 · 强袭科 · 爆发模式
   核心配色：亚里亚绯红 + M1911枪械黑 + 武侦徽章金
   ================================================================= */

/* === 强袭科 (Assault Department) 风格思维链样式 === */
.cot-container details {
    --aria-crimson: #d50000;
    --aria-pink: #f8bbd0;
    --gunmetal-dark: #212121;
    --gunmetal-light: #455a64;
    
    --butei-gold: #ffd700;
    --reki-green: #66bb6a;
    --hysteria-purple: #ab47bc;
    
    --tactical-bg: #1a1a1a;
    --tactical-grid: #263238;

    background-color: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(8px);
    
    border: 1px solid rgba(117, 117, 117, 0.5);
    border-left: 4px solid var(--aria-crimson);
    border-radius: 2px;
    
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #eceff1;
    line-height: 1.6;
    margin: 18px 0;
    position: relative;
    overflow: hidden;
    
    box-shadow: 
        0 4px 10px rgba(0, 0, 0, 0.8), 
        0 0 5px rgba(213, 0, 0, 0.2),
        inset 0 0 30px rgba(0, 0, 0, 0.5); 
        
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.cot-container details:hover {
    border-color: var(--aria-crimson);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.9), 
        0 0 15px rgba(213, 0, 0, 0.4),
        inset 0 0 2px var(--butei-gold);
}

.cot-container details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--aria-crimson), 
        var(--butei-gold), 
        var(--hysteria-purple), 
        transparent
    );
    opacity: 0.9;
    z-index: 10;
}

/* === 标题栏 (任务简报) === */
.cot-container summary {
    background: linear-gradient(135deg, #212121 0%, #37474f 100%);
    color: #fff;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.cot-container summary:hover {
    background: linear-gradient(135deg, #2c000e 0%, #4a1425 100%);
    color: var(--butei-gold);
    text-shadow: 0 0 8px var(--aria-crimson);
}

.cot-container summary::before {
    content: '⌖';
    color: #9e9e9e;
    margin-right: 12px;
    font-size: 1.4em;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), color 0.3s ease;
    line-height: 1;
}

.cot-container details[open] summary::before {
    transform: rotate(90deg) scale(1.1);
    color: var(--aria-crimson);
    text-shadow: 0 0 10px var(--aria-crimson);
}

.cot-container summary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--aria-crimson), var(--butei-gold));
    box-shadow: 0 0 8px var(--aria-crimson);
    transition: width 0.4s ease;
}

.cot-container details[open] summary::after {
    width: 100%;
}

/* === 内容区域 (情报终端) === */
.cot-container details > div, 
.cot-container .cot-content {
    padding: 24px 28px;
    background-color: rgba(33, 33, 33, 0.95);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 分割线 - 弹道轨迹 */
.cot-container hr {
    border: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, 
        var(--aria-crimson), 
        var(--aria-crimson) 5px, 
        transparent 5px, 
        transparent 10px
    );
    margin: 25px 0;
    opacity: 0.7;
    box-shadow: 0 0 5px var(--aria-crimson);
}

.cot-container p {
    margin-bottom: 1.2em;
    text-align: justify;
    color: #bdbdbd;
}

.cot-container strong {
    color: var(--butei-gold);
    font-weight: bold;
    text-shadow: 0 0 1px rgba(255, 215, 0, 0.3);
}

.cot-container p:first-of-type::first-letter {
    font-family: 'Impact', sans-serif;
    font-size: 2.2em;
    color: #fff;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #b71c1c, #d50000);
    border: 1px solid #ff8a80;
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.cot-container ul, .cot-container ol {
    padding-left: 10px;
    margin: 15px 0;
}

.cot-container li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    list-style: none;
}

.cot-container ul li::before {
    content: '➳';
    color: var(--aria-crimson);
    position: absolute;
    left: 0;
    font-size: 1.1em;
    top: 1px;
    text-shadow: 0 0 3px rgba(213, 0, 0, 0.5);
}

.cot-container pre, .cot-container code {
    font-family: 'Consolas', monospace;
    background-color: #000;
    border: 1px solid #37474f; 
    border-radius: 2px;
    padding: 2px 6px;
    color: var(--aria-pink);
    font-size: 0.9em;
}

.cot-container pre {
    padding: 16px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 3px solid var(--butei-gold);
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.8),
        rgba(0, 0, 0, 0.8) 2px,
        rgba(30, 30, 30, 0.8) 3px
    );
}

.cot-container a {
    color: var(--aria-crimson);
    text-decoration: none;
    border-bottom: 1px solid var(--aria-crimson);
    transition: all 0.2s;
    font-weight: bold;
}

.cot-container a:hover {
    color: var(--butei-gold);
    border-bottom-color: var(--butei-gold);
    background-color: rgba(213, 0, 0, 0.1);
}

.cot-container summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 768px) {
    .cot-container details {
        margin: 15px 0;
        border-radius: 4px;
    }
    .cot-container summary {
        padding: 14px 18px;
    }
}

/* =================================================================
   绯弹的亚里亚主题：神崎·H·亚里亚 · 东京武侦高中
   核心配色：绯弹红(双马尾/眼眸) + 枪械黑(M1911) + 武侦金(徽章)
   Rili平台适配
   ================================================================= */

/* --- 1. 顶部装饰条净化 (B平台使用border而非绝对定位装饰条) --- */
/* B平台气泡的border即为装饰，直接在气泡样式中覆盖 */

/* --- 2. 聊天气泡 - 用户输入框 (核心需求：亚里亚的绯红色调) --- */
/* B平台用户气泡选择器 */
.is-user .group-\[\.is-user\]\:bg-secondary {
    /* 背景：极淡的樱花粉，象征亚里亚的少女一面 */
    background: linear-gradient(135deg, #fff0f5 0%, #ffebee 100%) !important;
    /* 边框：双剑/双枪的锐利感 */
    border: 1px solid #f06292 !important;
    border-left: 5px solid #c2185b !important; /* 强袭科的红色识别条 */
    border-radius: 4px 16px 16px 16px !important; /* 更加硬朗的棱角 */
    /* 阴影：战斗中的火光 */
    box-shadow: 
        3px 3px 10px rgba(194, 24, 91, 0.1), 
        inset 0 0 20px rgba(255, 255, 255, 0.8) !important;
    color: #212121 !important; /* 黑色制服，保证阅读清晰度 */
}

/* --- 2b. 聊天气泡 - AI回复框 --- */
.is-assistant .group-\[\.is-assistant\]\:bg-card {
    /* 背景：极淡的樱花粉，与用户框统一风格 */
    background: linear-gradient(135deg, #fff0f5 0%, #ffebee 100%) !important;
    border: 1px solid #f06292 !important;
    border-left: 5px solid #c2185b !important;
    border-radius: 4px 16px 16px 16px !important;
    box-shadow: 
        3px 3px 10px rgba(194, 24, 91, 0.1), 
        inset 0 0 20px rgba(255, 255, 255, 0.8) !important;
    color: #212121 !important;
}

/* 气泡文字 - 用户 */
.is-user .rili-markdown-renderer {
    color: #3e2723 !important; /* 深褐色，柔和但严肃 */
    font-family: "Microsoft YaHei", sans-serif !important;
}

/* 气泡文字 - AI */
.is-assistant .rili-markdown-renderer {
    color: #3e2723 !important;
    font-family: "Microsoft YaHei", sans-serif !important;
}

/* 强调文字 (开洞/爆发模式风格) */
.is-user .rili-markdown-renderer strong,
.is-assistant .rili-markdown-renderer strong {
    color: #d50000 !important; 
    text-shadow: 0px 0px 3px rgba(213, 0, 0, 0.3) !important;
    font-weight: 900 !important;
    border-bottom: 2px dashed #ff8a80;
}

/* 代码块背景适配 (装备科风格) */
.is-user .rili-markdown-renderer pre,
.is-assistant .rili-markdown-renderer pre {
    background-color: #263238 !important; /* 枪械蓝黑 */
    border: 1px solid #455a64 !important;
    color: #eceff1 !important; /* 银色文字 */
}

/* --- 3. 按钮组 (M1911政府型/双枪风格) --- */
/* B平台操作按钮容器 */
.bg-muted.rounded.flex.p-0\.5 button {
    background: linear-gradient(180deg, #424242, #212121) !important; /* 枪身黑 */
    color: #fce4ec !important; /* 樱花粉文字，反差萌 */
    border: 1px solid #757575 !important; /* 银色枪机 */
    border-bottom: 2px solid #000000 !important;
    border-radius: 2px !important; /* 机械的直角感 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
    font-weight: bold !important;
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
}

.bg-muted.rounded.flex.p-0\.5 button:hover {
    background: linear-gradient(135deg, #e91e63, #c2185b) !important; /* 悬停时变为绯红色 */
    color: #ffffff !important;
    border-color: #ff80ab !important;
    box-shadow: 0 0 12px rgba(233, 30, 99, 0.6) !important;
    transform: translateY(-1px);
}

/* B平台按钮内SVG图标颜色适配 */
.bg-muted.rounded.flex.p-0\.5 button svg {
    stroke: #fce4ec !important;
}

.bg-muted.rounded.flex.p-0\.5 button:hover svg {
    stroke: #ffffff !important;
}

/* --- 4. 底部输入框 (狙击镜/雷姬风格) --- */
/* B平台输入框 - 使用textarea或input选择器 */
textarea[placeholder],
.flex.items-end textarea,
div[class*="chat"] textarea {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #212121 !important;
    border: 1px solid #9e9e9e !important;
    border-left: 4px solid #d50000 !important; /* 绯弹红 */
    border-radius: 0px !important; /* 战术方框 */
}

textarea[placeholder]:focus,
.flex.items-end textarea:focus,
div[class*="chat"] textarea:focus {
    box-shadow: 0 0 0 2px rgba(213, 0, 0, 0.2) !important;
    border-color: #d50000 !important; /* 锁定目标红 */
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(233, 30, 99, 0.03) 10px, rgba(233, 30, 99, 0.03) 20px) !important;
}

textarea[placeholder]::placeholder,
.flex.items-end textarea::placeholder,
div[class*="chat"] textarea::placeholder {
    color: rgba(189, 189, 189, 0.8) !important;
    font-style: italic;
}

/* --- 5. 消耗详情/模型信息 (B平台token显示区域) --- */
/* B平台的token信息显示在按钮栏左侧 */
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
    color: #ab47bc !important; /* 爆发模式·神秘紫 */
    font-weight: bold !important;
}

.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground span .bg-blue-500\/60 {
    background-color: #ffd700 !important; /* 武侦金替代蓝色圆点 */
}

.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground span .bg-green-500\/60 {
    background-color: #d50000 !important; /* 绯弹红替代绿色圆点 */
}

/* =========================================
   Hidan no Aria Theme - 绯弹的武装侦探战术终端
   加载动画 - Rili平台适配版
   ========================================= */

/* 1. 隐藏B平台默认的三个弹跳圆点 */
.flex.gap-2.w-full.h-full.items-center.justify-center span {
    display: none !important;
}

/* 2. 加载容器扩大尺寸以容纳完整战术UI阵列 */
.flex.gap-2.w-full.h-full.items-center.justify-center {
    position: relative !important;
    min-width: 80px !important;
    min-height: 80px !important;
    width: 80px !important;
    height: 80px !important;
    overflow: visible !important;
}

/* 3. 战术UI外圈：枪灰色的左轮弹巢刻度、绯红狙击准星与战术字符（顺时针旋转，SMIL SVG动画） */
.flex.gap-2.w-full.h-full.items-center.justify-center::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80px !important;
    height: 80px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cfilter id='glow'%3E%3CfeGaussianBlur stdDeviation='2' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23glow)'%3E%3Ccircle cx='100' cy='100' r='90' fill='none' stroke='%23C0C0C0' stroke-width='6' stroke-dasharray='30 15' opacity='0.8'/%3E%3Ccircle cx='100' cy='100' r='75' fill='none' stroke='%23DC143C' stroke-width='2' opacity='0.9'/%3E%3Ccircle cx='100' cy='100' r='70' fill='none' stroke='%23DC143C' stroke-width='1' stroke-dasharray='4 4' opacity='0.7'/%3E%3Cline x1='100' y1='5' x2='100' y2='25' stroke='%23DC143C' stroke-width='3'/%3E%3Cline x1='100' y1='175' x2='100' y2='195' stroke='%23DC143C' stroke-width='3'/%3E%3Cline x1='5' y1='100' x2='25' y2='100' stroke='%23DC143C' stroke-width='3'/%3E%3Cline x1='175' y1='100' x2='195' y2='100' stroke='%23DC143C' stroke-width='3'/%3E%3Cg font-family='sans-serif' font-size='14' font-weight='bold' text-anchor='middle'%3E%3Ctext x='100' y='48' fill='%23DC143C'%3EASSAULT%3C/text%3E%3Ctext x='100' y='162' fill='%23C0C0C0'%3EBUTEI%3C/text%3E%3C/g%3E%3C/g%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 100 100' to='360 100 100' dur='5s' repeatCount='indefinite'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    z-index: 1 !important;
}

/* 4. 战术UI内层：武侦樱花徽记（逆时针缓慢旋转）+ 疾速战术雷达扫描 + 中心绯弹脉动（SMIL SVG动画） */
.flex.gap-2.w-full.h-full.items-center.justify-center::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 80px !important;
    height: 80px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg%3E%3Cg fill='none' stroke='%23FFB7C5' stroke-width='3' opacity='0.8'%3E%3Ccircle cx='100' cy='65' r='18'/%3E%3Ccircle cx='65' cy='90' r='18'/%3E%3Ccircle cx='135' cy='90' r='18'/%3E%3Ccircle cx='78' cy='130' r='18'/%3E%3Ccircle cx='122' cy='130' r='18'/%3E%3C/g%3E%3Ccircle cx='100' cy='100' r='45' fill='none' stroke='%23C0C0C0' stroke-width='1.5' stroke-dasharray='10 5'/%3E%3CanimateTransform attributeName='transform' type='rotate' from='360 100 100' to='0 100 100' dur='4s' repeatCount='indefinite'/%3E%3C/g%3E%3Cg%3E%3Cpolygon points='100,75 110,95 110,125 90,125 90,95' fill='%23DAA520' stroke='%23C0C0C0' stroke-width='1'/%3E%3Cpolygon points='100,75 106,89 94,89' fill='%23DC143C'/%3E%3Canimate attributeName='opacity' values='0.5;1;0.5' dur='1s' repeatCount='indefinite'/%3E%3C/g%3E%3Cpath d='M 100 100 L 100 55 A 45 45 0 0 1 145 100 Z' fill='%23DC143C' opacity='0.3'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 100 100' to='360 100 100' dur='1.5s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    z-index: 2 !important;
    pointer-events: none !important;
}

/* 5. CSS增强动画（在SMIL基础上叠加绯红色与枪灰金属光晕脉动，增强火力全开的机械质感） */
@keyframes ariaTacticalPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 4px rgba(220, 20, 60, 0.6)) drop-shadow(0 0 6px rgba(192, 192, 192, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 12px rgba(220, 20, 60, 1)) drop-shadow(0 0 10px rgba(255, 183, 197, 0.6));
    }
}

.flex.gap-2.w-full.h-full.items-center.justify-center::before,
.flex.gap-2.w-full.h-full.items-center.justify-center::after {
    animation: ariaTacticalPulse 1.5s ease-in-out infinite !important;
}

/* 6. 移动端适配 */
@media (max-width: 480px) {
    .flex.gap-2.w-full.h-full.items-center.justify-center {
        min-width: 60px !important;
        min-height: 60px !important;
        width: 60px !important;
        height: 60px !important;
    }
    .flex.gap-2.w-full.h-full.items-center.justify-center::before,
    .flex.gap-2.w-full.h-full.items-center.justify-center::after {
        width: 60px !important;
        height: 60px !important;
    }
}

/* 7. 低动效用户偏好适配：降低旋转与扫描频率但保留动效可见性 */
@media (prefers-reduced-motion: reduce) {
    .flex.gap-2.w-full.h-full.items-center.justify-center::before,
    .flex.gap-2.w-full.h-full.items-center.justify-center::after {
        animation-duration: 6s !important;
    }
}