/* --- 黑暗修仙·众生皆为我炉鼎 主题UI (APP兼容版) --- */

.max-w-\[720px\] {
    --dialogue-bg: #110d0f;
    --dialogue-border: #4a1a22;
    --dialogue-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    --details-border-color: #4a1a22;
    --details-header-bg: #1e1318;
    --details-header-bg-hover: #2a171e;
    --details-header-shadow: 0 4px 10px rgba(192,57,43,0.15);
    --details-header-shadow-hover: 0 6px 15px rgba(192,57,43,0.25);
    --content-bg: #1a1015;
    --text-color-primary: #e8d5c0;
    --text-color-secondary: #b8a090;
    --text-color-title: #f0d080;
    --border-radius-main: 4px;
    --border-radius-inner: 2px;
}

/* --- 全局颜色调整 --- */
.markdown-body {
    color: #e8d5c0 !important;
    background: #0a0608 !important;
}

/* --- 正文文字大小修正 --- */
.markdown-body p {
    font-size: 16px !important;
    line-height: 1.9 !important;
    color: #e8d5c0 !important;
}

/* --- 对话框样式 --- */
.chat-container .group .relative.inline-block {
    background-color: #110d0f !important;
    border: 1px solid #4a1a22 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7) !important;
    border-radius: 4px !important;
    color: #e8d5c0 !important;
}

.chat-container .group .relative.inline-block > .MuiBox-root.css-0 {
    display: none !important;
}

/* --- 对话框内所有文字颜色强制修正 --- */
.chat-container .group .relative.inline-block * {
    color: #e8d5c0 !important;
}

/* --- 对话框内按钮 (复制, 编辑等) --- */
.chat-container .group .MuiButtonBase-root.MuiButton-root.MuiButton-text {
    background: #1a1015 !important;
    color: #b8a090 !important;
    border: 1px solid #4a1a22 !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4) !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
    padding: 4px 12px !important;
    min-width: auto !important;
    line-height: 1.5 !important;
}

.chat-container .group .MuiButtonBase-root.MuiButton-root.MuiButton-text:hover {
    background: #1e1318 !important;
    color: #f0d080 !important;
    border-color: #c9a84c !important;
    box-shadow: 0 0 8px rgba(201,168,76,0.3) !important;
}

/* --- 状态栏容器 (Details) --- */
.markdown-body details {
    border: 1px solid #4a1a22 !important;
    border-radius: 4px !important;
    margin: 16px 0 !important;
    background-color: #1a1015 !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
}

.markdown-body details:hover {
    box-shadow: 0 0 16px rgba(192,57,43,0.2) !important;
    border-color: #c0392b !important;
}

/* --- 状态栏标题 (Summary) --- */
.markdown-body summary {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    cursor: pointer !important;
    background: #1e1318 !important;
    color: #f0d080 !important;
    font-weight: 600 !important;
    font-size: 1.1em !important;
    letter-spacing: 0.1em !important;
    transition: all 0.3s ease !important;
    outline: none !important;
    list-style: none !important;
    position: relative !important;
    border-bottom: 1px solid rgba(74,26,34,0.6) !important;
}

.markdown-body summary::-webkit-details-marker {
    display: none !important;
}

.markdown-body summary:hover {
    background: #2a171e !important;
}

.markdown-body summary::before {
    content: '◆' !important;
    display: inline-block !important;
    margin-right: 10px !important;
    font-size: 0.8em !important;
    color: #c0392b !important;
}

.markdown-body details[open] > summary::before {
    transform: rotate(90deg) !important;
}

/* --- 状态栏内容区 (代码块等) --- */
.markdown-body details > pre,
.markdown-body details > table {
    margin: 0 !important;
    border: none !important;
    border-top: none !important;
    border-radius: 0 !important;
    background-color: #0a0608 !important;
    overflow-x: auto !important;
}

.markdown-body details pre > div:first-child[style*="border-color"] {
    display: none !important;
}

.markdown-body details pre {
    padding: 0 !important;
    background: #0a0608 !important;
}

.markdown-body details pre > div[node="[object Object]"] {
    padding: 16px 20px !important;
    background: #0a0608 !important;
}

/* --- 状态栏内容字体修正 --- */
.markdown-body details pre code {
    font-size: 14px !important;
    line-height: 1.8 !important;
    color: #e8d5c0 !important;
    background: transparent !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* --- 状态栏内所有文字颜色强制修正 --- */
.markdown-body details * {
    color: #e8d5c0 !important;
}

/* --- 平台功能按钮 (Mod, 流式等) --- */
.flex.items-center.gap-2.pb-2 > button {
    background: #1a1015 !important;
    color: #b8a090 !important;
    border: 1px solid #4a1a22 !important;
    border-radius: 2px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
    font-weight: 500 !important;
    text-transform: none !important;
    transition: all 0.3s ease !important;
    padding: 6px 14px !important;
}

.flex.items-center.gap-2.pb-2 > button:hover {
    background: #1e1318 !important;
    color: #f0d080 !important;
    border-color: #c9a84c !important;
    box-shadow: 0 0 10px rgba(201,168,76,0.3) !important;
}

/* --- 输入框美化 --- */
#ai-chat-input {
    background-color: #1a1015 !important;
    border: 1px solid #4a1a22 !important;
    border-radius: 2px !important;
    color: #e8d5c0 !important;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5) !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

#ai-chat-input:focus {
    border-color: #c0392b !important;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 0 12px rgba(192,57,43,0.3) !important;
}

/* 输入框容器 */
#ai-chat-bottom-input {
    background: #0a0608 !important;
    border-top: 1px solid #4a1a22 !important;
    padding: 8px !important;
}

/* --- 加载动画 - 旋转菱形 --- */
@keyframes ai-answer-spinner-rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 修正加载动画的父容器 */
div:has(> .style_dot-flashing__8L91Q.style_text__zGhNq) {
    justify-content: flex-start !important;
    width: auto !important;
    height: auto !important;
}

/* 修正加载动画的提示文字 */
div:has(> .style_dot-flashing__8L91Q.style_text__zGhNq)::after {
    content: '浊气汇聚中，推演天机...' !important;
    font-size: 14px !important;
    color: #c0392b !important;
    letter-spacing: 0.1em !important;
    margin-left: 12px !important;
}

/* 隐藏原版动画的伪元素 */
.style_dot-flashing__8L91Q.style_text__zGhNq::before,
.style_dot-flashing__8L91Q.style_text__zGhNq::after {
    content: none !important;
    display: none !important;
}

/* 将原版动画替换为旋转血色菱形 */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    position: relative !important;
    background: #c0392b !important;
    width: 14px !important;
    height: 14px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    animation: ai-answer-spinner-rotation 2s linear infinite !important;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%) !important;
    box-shadow: 0 0 8px rgba(192,57,43,0.6) !important;
}

/* --- 额外的APP兼容性修正 --- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: #f0d080 !important;
    border-bottom: 1px solid rgba(74,26,34,0.6) !important;
    padding-bottom: 0.3em !important;
}

.markdown-body a {
    color: #c0392b !important;
    text-decoration: none !important;
}

.markdown-body a:hover {
    text-decoration: underline !important;
    color: #c9a84c !important;
}

.markdown-body code {
    color: #f0d080 !important;
    background: #1a1015 !important;
    border: 1px solid #4a1a22 !important;
    border-radius: 2px !important;
    padding: 0.1em 0.3em !important;
}

.markdown-body blockquote {
    color: #b8a090 !important;
    border-left: 4px solid #c0392b !important;
    background: #110d0f !important;
    padding: 10px 16px !important;
    margin: 0 !important;
}

.markdown-body hr {
    background-color: #4a1a22 !important;
    height: 1px !important;
    border: none !important;
}