/* 
 * 《月下献祭 — 不死冰山美少女的百年冰棺》主题CSS 
 * 风格：哥特、冰冷、血腥、优雅
 * 修订v2：恢复对话颜色标记，优化输入框可读性
 */

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

/* ========== 2. 聊天框（AI回复）容器：深色冰棺基底 ========== */
.bg-gray-100\/90.relative.inline-block {
    background: linear-gradient(135deg, rgba(10, 12, 18, 0.98) 0%, rgba(22, 6, 10, 0.98) 100%) !important;
    border: 1px solid rgba(173, 216, 230, 0.25) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(135, 206, 250, 0.15) !important;
    backdrop-filter: blur(12px) !important;
    overflow: hidden !important;
    isolation: isolate !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: #F0F5FF !important; /* 确保内部文字默认亮色 */
}

/* 悬停血色溢出 */
.bg-gray-100\/90.relative.inline-block:hover {
    border-color: rgba(139, 0, 0, 0.6) !important;
    box-shadow: 0 0 25px rgba(139, 0, 0, 0.4), inset 0 0 25px rgba(139, 0, 0, 0.15) !important;
}

/* 月光流转动效 */
.bg-gray-100\/90.relative.inline-block::before {
    content: "" !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%) !important;
    z-index: 0 !important;
    pointer-events: none !important;
    animation: moon-drift 18s linear infinite !important;
}

@keyframes moon-drift {
    0% { transform: translate(-10%, -10%); }
    50% { transform: translate(10%, 10%); }
    100% { transform: translate(-10%, -10%); }
}

/* ========== 3. 正文内容样式：保留内联样式优先，避免覆盖对话颜色 ========== */
.markdown-body {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif !important;
    line-height: 1.8 !important;
    z-index: 1 !important;
    position: relative !important;
    text-rendering: optimizeLegibility !important;
    padding: 4px 0 !important;
    color: #F0F5FF !important; /* 默认文字亮色 */
}

/* 仅对无内联样式的普通文字强制亮色，有style属性的span不覆盖 */
.markdown-body :not(span[style*="color"]) {
    color: inherit !important; /* 继承父级亮色 */
}

/* 但需要特别处理可能出现的浅色背景元素（代码块、引用等） */
.markdown-body pre,
.markdown-body code,
.markdown-body blockquote,
.markdown-body table,
.markdown-body th,
.markdown-body td {
    background-color: #1A1E2E !important;
    color: #F0F5FF !important;
    border-color: rgba(173, 216, 230, 0.3) !important;
}

/* 粗体强调保留金瞳色 */
.markdown-body strong,
.markdown-body b {
    color: #FFD700 !important;
    background-color: transparent !important;
}

/* 链接色 */
.markdown-body a {
    color: #AAD0F5 !important;
}

/* 确保标题可读 */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: #E6F0FA !important;
    text-shadow: 0 0 5px rgba(173, 216, 230, 0.5) !important;
}

/* ========== 4. 玩家输入框区域优化：深色背景 + 高亮文字 ========== */
/* 覆盖 Material-UI 输入框基础样式 */
.MuiInputBase-root,
.MuiOutlinedInput-root,
textarea,
input[type="text"],
input[type="search"] {
    background-color: #1A2035 !important;  /* 深灰蓝底，与冰棺协调 */
    color: #F0F5FF !important;             /* 亮白文字 */
    border: 1px solid rgba(173, 216, 230, 0.3) !important;
    border-radius: 12px !important;
    caret-color: #ADD8E6 !important;       /* 光标冰蓝色 */
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* 聚焦状态增强 */
.MuiInputBase-root.Mui-focused,
.MuiOutlinedInput-root.Mui-focused,
textarea:focus,
input:focus {
    border-color: rgba(139, 0, 0, 0.7) !important;
    box-shadow: 0 0 12px rgba(139, 0, 0, 0.3) !important;
    outline: none !important;
}

/* 输入框内的占位符文字 */
.MuiInputBase-input::placeholder,
textarea::placeholder,
input::placeholder {
    color: rgba(240, 245, 255, 0.5) !important;
    font-style: italic !important;
}

/* 输入框容器背景（针对包裹层） */
.MuiFormControl-root {
    background-color: transparent !important;
}

/* 发送按钮等周边元素保持低饱和 */
.MuiButtonBase-root.MuiButton-root {
    color: #B0B8C5 !important;
}

.MuiButtonBase-root.MuiButton-root:hover {
    color: #FF5E5E !important;
    background-color: rgba(255, 94, 94, 0.12) !important;
}

/* ========== 5. 加载动画：滴血冰晶玫瑰 ========== */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important;
}

.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    background: transparent !important;
}

.flex.items-center.justify-center.w-6.h-5::before {
    content: "" !important;
    width: 24px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ADD8E6' d='M12,2L9,7L4,8L8,12L7,17L12,15L17,17L16,12L20,8L15,7L12,2Z'%3E%3Canimate attributeName='opacity' values='1;0.3;1' dur='2s' repeatCount='indefinite' /%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='10s' repeatCount='indefinite' /%3E%3C/path%3E%3Ccircle cx='12' cy='15' r='2' fill='%238B0000'%3E%3Canimate attributeName='r' values='1;3;1' dur='1.5s' repeatCount='indefinite' /%3E%3Canimate attributeName='fill-opacity' values='1;0.5;1' dur='1.5s' repeatCount='indefinite' /%3E%3C/circle%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: block !important;
}

/* ========== 6. 滚动条：冰封轨迹 ========== */
.markdown-body::-webkit-scrollbar {
    width: 4px !important;
}
.markdown-body::-webkit-scrollbar-track {
    background: rgba(10, 15, 20, 0.5) !important;
}
.markdown-body::-webkit-scrollbar-thumb {
    background: rgba(173, 216, 230, 0.4) !important;
    border-radius: 10px !important;
}
.markdown-body::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 0, 0, 0.6) !important;
}

/* ========== 7. 移动端适配 & 动画减弱 ========== */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block {
        max-width: 95% !important;
        margin: 5px auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-gray-100\/90.relative.inline-block::before {
        animation: none !important;
        opacity: 0.2 !important;
    }
}