/* ===================== 全局斗破苍穹风格底色 & 文字 ===================== */
html, body {
    background-color: #08080a !important;      /* 深邃玄黑 */
    color: #f0e6d2 !important;                /* 古卷暖白 */
}
/* 强制正文区域黑底白字，覆盖可能的外层样式 */
body, article, main, .content, section, 
.markdown-body, .post-content, .entry-content {
    background-color: #08080a !important;
    color: #f0e6d2 !important;
}
p, div, li, h1, h2, h3, h4, h5, h6, span, a:not(.special) {
    color: inherit;
}

/* ===================== 进度条 - 斗气四维（深蓝边框） ===================== */
progress, [class*="progress"], .cyber-progress {
    appearance: none !important;
    width: 130px !important;
    height: 16px !important;
    border-radius: 8px !important;
    border: 1px solid #1a6d9e !important;          /* 深蓝镶边 */
    background: rgba(0,0,0,0.8) !important;
    vertical-align: middle;
    margin: 0 8px;
    overflow: hidden;
    box-shadow: inset 0 0 12px rgba(26,109,158,0.4), 
                0 0 14px rgba(26,109,158,0.5);      /* 深蓝内敛 */
    position: relative;
}
progress::-webkit-progress-bar {
    background: rgba(0,0,0,0.8) !important;
    border-radius: 8px;
}
progress::-webkit-progress-value {
    border-radius: 8px;
    background-size: 200% 100% !important;
    animation: progress-shine 2.5s linear infinite;
}
progress::-moz-progress-bar {
    border-radius: 8px;
    background-size: 200% 100%;
}
@keyframes progress-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 生命值 - 青绿生机 */
progress:nth-of-type(1)::-webkit-progress-value {
    background: linear-gradient(90deg, #1abc9c, #16a085, #1abc9c) !important;
}
progress:nth-of-type(1)::-moz-progress-bar {
    background: linear-gradient(90deg, #1abc9c, #16a085) !important;
}
/* 体力值 - 冰蓝玄气 */
progress:nth-of-type(2)::-webkit-progress-value {
    background: linear-gradient(90deg, #3498db, #5dade2, #3498db) !important;
}
progress:nth-of-type(2)::-moz-progress-bar {
    background: linear-gradient(90deg, #3498db, #5dade2) !important;
}
/* 好感度 - 桃花嫣然 */
progress:nth-of-type(3)::-webkit-progress-value {
    background: linear-gradient(90deg, #e84393, #fd79a8, #e84393) !important;
}
progress:nth-of-type(3)::-moz-progress-bar {
    background: linear-gradient(90deg, #e84393, #fd79a8) !important;
}
/* 警惕值 - 赤红警戒 */
progress:nth-of-type(4)::-webkit-progress-value {
    background: linear-gradient(90deg, #e74c3c, #c0392b, #e74c3c) !important;
}
progress:nth-of-type(4)::-moz-progress-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b) !important;
}

/* ===================== Details 折叠面板 - 玄重尺匣（深蓝边框） ===================== */
details, .cyber-details {
    background: rgba(0,0,0,0.85) !important;
    backdrop-filter: blur(12px) saturate(1.6);
    border: 1px solid #1a6d9e !important;                /* 深蓝边框 */
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(26,109,158,0.7), 
                inset 0 0 20px rgba(26,109,158,0.15);     /* 深蓝宝光 */
    padding: 20px;
    margin-top: 20px;
    color: #f0e6d2 !important;                            /* 正文暖白 */
    position: relative;
    overflow: visible;
    transition: box-shadow 0.3s ease;
}
details:hover, .cyber-details:hover {
    box-shadow: 0 0 40px rgba(26,109,158,1), 
                inset 0 0 25px rgba(26,109,158,0.3);
}
/* --- 新增边角装饰 --- */
details::before,
details::after {
    content: "";
    position: absolute;
    width: 12px; height: 12px;
    border: 2px solid #3ba9d9;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}
details::before {
    top: -1px; left: -1px;
    border-right: none; border-bottom: none;
    border-radius: 3px 0 0 0;
    box-shadow: -2px -2px 6px rgba(59,169,217,0.5);
}
details::after {
    bottom: -1px; right: -1px;
    border-left: none; border-top: none;
    border-radius: 0 0 3px 0;
    box-shadow: 2px 2px 6px rgba(59,169,217,0.5);
}

summary {
    color: #3ba9d9 !important;                           /* 冰蓝古字 */
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(26,109,158,0.9), 
                 0 0 20px rgba(26,109,158,0.6);
    padding: 12px 20px;
    background: linear-gradient(145deg, #0b1f2e, #1a374a); /* 深海暗蓝 */
    border-radius: 12px;
    margin: -18px -18px 15px -18px;
    list-style: none;
    outline: none;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
summary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59,169,217,0.2), transparent);
    animation: summary-sweep 3s infinite;
}
@keyframes summary-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}
summary::-webkit-details-marker { display: none; }
summary::before {
    content: "▶";
    color: #1a6d9e;
    margin-right: 12px;
    font-size: 1.1em;
    transition: transform 0.3s;
    filter: drop-shadow(0 0 5px #1a6d9e);
}
details[open] summary::before { transform: rotate(90deg); }
summary:hover {
    background: linear-gradient(145deg, #1a374a, #26587a);
    color: #5ec8f0;
    text-shadow: 0 0 12px #1a6d9e;
}
/* 列表标记改为深蓝 */
details li::marker {
    color: #1a6d9e;
    text-shadow: 0 0 5px #1a6d9e;
}

/* 修复 details 内部样式干扰进度条（颜色同步） */
details > :where(p, div, ul, ol, dl, blockquote, pre, h1, h2, h3, h4, h5, h6, table) {
    color: #f0e6d2 !important;
    padding: 10px 0;
    margin-left: 12px;
    border-left: 3px solid transparent;
    padding-left: 15px;
    transition: all 0.25s ease;
}
details > :where(p, div, ul, ol, dl, blockquote, pre, h1, h2, h3, h4, h5, h6, table):hover {
    background-color: rgba(26,109,158,0.15);
    border-left: 3px solid #1a6d9e;
    box-shadow: 0 0 10px rgba(26,109,158,0.4);
}
details progress, details button, details input {
    border-left: none !important;
    padding-left: initial !important;
    margin-left: 0 !important;
}

/* ===================== Tooltip - 炎帝秘闻（深蓝悬停） ===================== */
t {
    cursor: pointer !important;
    color: #1a6d9e !important;
    text-decoration: underline dotted #3ba9d9 !important;
    position: relative !important;
    display: inline-block !important;
    outline: none !important;
    user-select: none !important;
    z-index: 99 !important;
}

ti {
    display: none !important;
    position: absolute !important;
    bottom: calc(100% + 10px) !important;
    left: 0 !important;
    background: linear-gradient(145deg, #0b1f2e, #1a374a) !important;  /* 深海暗蓝 */
    border: 2px solid #1a6d9e !important;
    border-radius: 8px !important;
    box-shadow: 0 0 18px rgba(26,109,158,0.9), 
                inset 0 0 10px rgba(26,109,158,0.4) !important;
    padding: 8px 12px !important;
    color: #f0e6d2 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    width: 200px !important;
    max-width: 90vw !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    z-index: 1000 !important;
    backdrop-filter: blur(10px) !important;
    text-align: left !important;
    pointer-events: auto !important;
}

ti::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: 12px !important;
    margin-left: 0 !important;
    border-width: 6px !important;
    border-style: solid !important;
    border-color: #1a6d9e transparent transparent transparent !important;
}

t:hover > ti,
t:active > ti,
t:focus > ti {
    display: block !important;
}
t:hover {
    z-index: 1001 !important;
    outline: 2px solid #3ba9d9 !important;
    outline-offset: 2px !important;
}

.tooltip-close,
.tooltip-overlay {
    display: none !important;
}

/* ===================== 预设输入框 - 深蓝斗气溢出 ===================== */
input[type="text"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="email"],
textarea,
select {
    background: rgba(0,0,0,0.8) !important;
    border: 1px solid #1a6d9e !important;
    color: #f0e6d2 !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    outline: none !important;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(26,109,158,0.5), 
                inset 0 0 5px rgba(26,109,158,0.2);
    caret-color: #3ba9d9;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #1a6d9e !important;
    box-shadow: 0 0 20px rgba(26,109,158,0.9), 
                0 0 40px rgba(26,109,158,0.6), 
                inset 0 0 10px rgba(26,109,158,0.4);
    animation: input-glow-pulse 1.5s infinite alternate;
}

@keyframes input-glow-pulse {
    from { 
        box-shadow: 0 0 15px rgba(26,109,158,0.7), 
                    0 0 30px rgba(26,109,158,0.5), 
                    inset 0 0 5px rgba(26,109,158,0.3); 
    }
    to { 
        box-shadow: 0 0 25px rgba(26,109,158,1), 
                    0 0 50px rgba(26,109,158,0.8), 
                    inset 0 0 12px rgba(26,109,158,0.5); 
    }
}

/* ===================== 默认按钮 - 深蓝斗气溢出 ===================== */
button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn {
    background: linear-gradient(145deg, #0b1f2e, #1a374a) !important;
    border: 1px solid #1a6d9e !important;
    color: #f0e6d2 !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(26,109,158,0.8);
    box-shadow: 0 0 10px rgba(26,109,158,0.5), 
                inset 0 0 5px rgba(26,109,158,0.3);
    transition: all 0.3s ease;
    outline: none;
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.btn:hover {
    background: linear-gradient(145deg, #1a374a, #26587a) !important;
    border-color: #3ba9d9 !important;
    box-shadow: 0 0 25px rgba(26,109,158,0.9), 
                0 0 45px rgba(26,109,158,0.6), 
                inset 0 0 10px rgba(26,109,158,0.5);
    color: #a0e7ff !important;
    text-shadow: 0 0 12px #1a6d9e;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
.btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 15px rgba(26,109,158,0.8), 
                inset 0 0 15px rgba(26,109,158,0.6);
}


/* ===================== 聊天气泡框美化（深蓝主题适配） ===================== */

/* 用户输入气泡框 (User) - 带有淡蓝光晕的深色玻璃质感 */
.group.is-user > div:first-child {
    background: linear-gradient(145deg, #0f2a3f, #163d5a) !important;
    border: 1px solid #1a6d9e !important;
    border-radius: 18px 4px 18px 18px !important;
    box-shadow: 0 0 15px rgba(26,109,158,0.4), inset 0 0 10px rgba(59,169,217,0.15) !important;
    backdrop-filter: blur(8px);
    color: #f0e6d2 !important;
    transition: all 0.3s ease;
    position: relative;
}
.group.is-user > div:first-child:hover {
    border-color: #3ba9d9 !important;
    box-shadow: 0 0 25px rgba(26,109,158,0.8), inset 0 0 15px rgba(59,169,217,0.3) !important;
}
/* 用户气泡右上角装饰光点 */
.group.is-user > div:first-child::after {
    content: "";
    position: absolute;
    top: -2px; right: -2px;
    width: 10px; height: 10px;
    background: #3ba9d9;
    border-radius: 50%;
    box-shadow: 0 0 12px #3ba9d9, 0 0 24px #1a6d9e;
    opacity: 0.9;
}

/* AI输出气泡框 (Assistant) - 沉稳深海玄色 */
.group.is-assistant > div:first-child {
    background: linear-gradient(145deg, #0b1f2e, #132f42) !important;
    border: 1px solid #1a6d9e !important;
    border-radius: 4px 18px 18px 18px !important;
    box-shadow: 0 0 12px rgba(0,0,0,0.6), inset 0 0 8px rgba(26,109,158,0.1) !important;
    backdrop-filter: blur(8px);
    color: #f0e6d2 !important;
    transition: all 0.3s ease;
    position: relative;
}
.group.is-assistant > div:first-child:hover {
    border-color: #1a6d9e !important;
    box-shadow: 0 0 20px rgba(26,109,158,0.5), inset 0 0 10px rgba(26,109,158,0.15) !important;
}
/* AI气泡左上角装饰光点 */
.group.is-assistant > div:first-child::before {
    content: "";
    position: absolute;
    top: -2px; left: -2px;
    width: 10px; height: 10px;
    background: #1a6d9e;
    border-radius: 50%;
    box-shadow: 0 0 10px #1a6d9e, 0 0 20px #0b1f2e;
    opacity: 0.8;
}

/* 全局聊天气泡框 (User与Assistant共用) - 统一边距和过渡 */
.group.is-user > div:first-child, 
.group.is-assistant > div:first-child {
    padding: 16px 18px !important;
    margin: 8px 0 !important;
    transition: all 0.3s ease;
}


/* ========================================
   文本内容区 (Markdown Content)
   ======================================== */

/* 聊天框内的主要文本内容 - 保证亮色文字穿透，并添加柔和的文本背景 */
.rili-markdown-renderer, 
.rili-markdown-renderer * {
    color: #f0e6d2 !important;
    line-height: 1.7 !important;
    font-size: 0.98rem !important;
}
/* 为段落添加极浅的半透明底色，提升可读性 */
.rili-markdown-renderer p {
    background: rgba(26,109,158,0.06);
    border-radius: 6px;
    padding: 6px 10px;
    margin: 8px 0;
}
/* 链接美化 */
.rili-markdown-renderer a {
    color: #5ec8f0 !important;
    text-decoration: underline dotted #3ba9d9 !important;
    transition: color 0.2s;
}
.rili-markdown-renderer a:hover {
    color: #a0e7ff !important;
    text-shadow: 0 0 8px #3ba9d9;
}
/* 代码块适应暗色环境 */
.rili-markdown-renderer code,
.rili-markdown-renderer pre {
    background: rgba(0,0,0,0.6) !important;
    border: 1px solid #1a6d9e !important;
    border-radius: 6px !important;
    color: #d0e8ff !important;
}


/* ========================================
   底部信息与操作按钮 (Meta & Action Buttons)
   ======================================== */

/* AI聊天框底部附加元素 (Token消耗/模型信息/绿点) */
.text-xs.font-mono.text-muted-foreground {
    color: #9bb8cc !important;               /* 浅蓝灰，便于阅读 */
    font-size: 0.75rem !important;
    opacity: 0.9 !important;
    text-shadow: 0 0 4px #1a6d9e;
}
/* 底部在线指示绿点改为冰蓝 */
.text-xs.font-mono.text-muted-foreground .text-green-500 {
    color: #3ba9d9 !important;
    background-color: #3ba9d9 !important;
    box-shadow: 0 0 6px #3ba9d9;
}

/* 底部操作按钮区容器 (含刷新/复制/编辑等) */
.bg-muted.rounded.flex {
    background: transparent !important;       /* 去除默认背景 */
    border-radius: 8px !important;
    padding: 2px 4px !important;
}

/* 底部单个操作按钮 */
.bg-muted.rounded.flex button {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    color: #9bb8cc !important;
    transition: all 0.2s ease;
}
.bg-muted.rounded.flex button:hover {
    background: rgba(26,109,158,0.15) !important;
    border-color: #1a6d9e !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(26,109,158,0.5);
}

/* 底部操作按钮的图标 (SVG) */
.bg-muted.rounded.flex button svg.lucide {
    stroke: currentColor !important;
    width: 16px !important;
    height: 16px !important;
    transition: all 0.2s;
}
.bg-muted.rounded.flex button:hover svg.lucide {
    stroke: #ffffff !important;
    filter: drop-shadow(0 0 4px #3ba9d9);
}

/* 强制一直显示操作按钮 (覆盖原生非 hover 时 opacity 为 0 的设定) */
.group .md\:opacity-0 {
    opacity: 1 !important;
}


/* ========================================
   加载动画控制 (Loading Animation)
   ======================================== */

/* 加载动画外层容器 */
.flex.gap-2.w-full.h-full.items-center.justify-center {
    position: relative;
    background: transparent !important;
    min-height: 40px;
}

/* 原生自带的3个跳动加载点 - 替换为冰蓝色光点 */
.flex.gap-2.w-full.h-full.items-center.justify-center > span {
    display: inline-block !important;
    background: #3ba9d9 !important;
    box-shadow: 0 0 10px #3ba9d9, 0 0 20px #1a6d9e;
    border-radius: 50% !important;
    width: 8px !important;
    height: 8px !important;
    animation: pulse-dot 1.4s infinite ease-in-out both;
}
.flex.gap-2.w-full.h-full.items-center.justify-center > span:nth-child(1) { animation-delay: -0.32s; }
.flex.gap-2.w-full.h-full.items-center.justify-center > span:nth-child(2) { animation-delay: -0.16s; }

@keyframes pulse-dot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}