/* ═══════════════════════════════════════════
   尘墟界·修仙状态栏主题 - rili专用版
   ═══════════════════════════════════════════ */

/* --- 状态栏容器 (Details) - 玉简卷轴风 --- */
.markdown-body details {
    border: 1px solid #c9a84c;
    border-radius: 10px;
    margin: 14px 0;
    background-color: #0c0c18;
    overflow: hidden;
    transition: box-shadow 0.35s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(0, 0, 0, 0.4);
    position: relative;
}

.markdown-body details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.03) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 50%, rgba(201, 168, 76, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.markdown-body details:hover {
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.18), 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(0, 0, 0, 0.4);
}

/* --- 标题栏 (Summary) - 铭文玉牌风 --- */
.markdown-body summary {
    display: flex;
    align-items: center;
    padding: 13px 20px;
    cursor: pointer;
    background: linear-gradient(135deg, #161628 0%, #0f0f1e 60%, #0c0c18 100%);
    color: #ffd866;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    outline: none;
    list-style: none;
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    text-shadow: 0 0 12px rgba(255, 216, 102, 0.35), 0 1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 1;
}

.markdown-body summary::-webkit-details-marker {
    display: none;
}

.markdown-body summary:hover {
    background: linear-gradient(135deg, #1e1e3a 0%, #161628 60%, #0f0f1e 100%);
    text-shadow: 0 0 18px rgba(255, 216, 102, 0.55), 0 1px 2px rgba(0, 0, 0, 0.8);
    color: #ffe699;
}

/* Summary 左侧装饰符 */
.markdown-body summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 0.9em;
    color: #c9a84c;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.4));
}

.markdown-body details[open] > summary::after {
    transform: rotate(90deg);
    color: #ffd866;
}

/* Summary 底部灵气光线 */
.markdown-body details[open] > summary {
    border-bottom: 1px solid rgba(201, 168, 76, 0.35);
    box-shadow: 0 2px 8px rgba(201, 168, 76, 0.1);
}

/* --- 内容区全局文字 --- */
.markdown-body details > p,
.markdown-body details > ul,
.markdown-body details > ol,
.markdown-body details > blockquote {
    padding: 4px 20px;
    margin: 2px 0;
    color: #d6cab4;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* --- ◈ 符号高亮 --- */
.markdown-body details > p > strong,
.markdown-body details strong {
    color: #ffd866;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(255, 216, 102, 0.2);
}

/* --- 分割线 --- */
.markdown-body details > hr,
.markdown-body details hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(201, 168, 76, 0.3) 30%, rgba(201, 168, 76, 0.5) 50%, rgba(201, 168, 76, 0.3) 70%, transparent 95%);
    margin: 10px 16px;
}

/* --- 记忆回廊 - 表格美化 --- */
.markdown-body details table {
    border-collapse: collapse;
    width: calc(100% - 32px);
    margin: 8px 16px;
    position: relative;
    z-index: 1;
}

.markdown-body details th {
    background: linear-gradient(135deg, #1a1a30, #12122a);
    color: #ffd866;
    padding: 9px 12px;
    border: 1px solid rgba(201, 168, 76, 0.3);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 216, 102, 0.2);
}

.markdown-body details td {
    background: rgba(10, 10, 20, 0.6);
    color: #d6cab4;
    padding: 8px 12px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    font-size: 13px;
    line-height: 1.5;
}

.markdown-body details tr:hover td {
    background: rgba(22, 22, 40, 0.8);
}

/* --- 命运罗盘 - 引用块美化 --- */
.markdown-body details > blockquote,
.markdown-body details blockquote {
    border-left: 3px solid #c9a84c;
    background: rgba(22, 22, 40, 0.5);
    padding: 10px 16px;
    margin: 10px 16px;
    color: #e8dcc6;
    border-radius: 0 6px 6px 0;
    font-style: normal;
    position: relative;
    z-index: 1;
}

.markdown-body details blockquote strong {
    color: #ffd866;
}

/* --- 正文区域文字基础 --- */
.markdown-body {
    color: #d6cab4;
}

.markdown-body p {
    font-size: 16px !important;
    line-height: 1.85 !important;
}

/* --- 正文标题 --- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: #ffd866;
    text-shadow: 0 0 12px rgba(255, 216, 102, 0.25);
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
    padding-bottom: 6px;
}

/* --- 正文分割线 --- */
.markdown-body hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c9a84c, transparent);
    margin: 22px 0;
}

/* --- 正文链接 --- */
.markdown-body a {
    color: #ffd866;
    text-decoration: none;
    border-bottom: 1px dashed rgba(201, 168, 76, 0.35);
    transition: all 0.2s ease;
}

.markdown-body a:hover {
    color: #ffe699;
    border-bottom-color: #ffe699;
    text-shadow: 0 0 6px rgba(255, 216, 102, 0.4);
}

/* --- 列表标记 --- */
.markdown-body li::marker {
    color: #c9a84c;
}

/* --- 对话气泡框 --- */
.chat-container .group .relative.inline-block {
    background-color: #0c0c18;
    border: 1px solid rgba(201, 168, 76, 0.25);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(201, 168, 76, 0.05);
    border-radius: 10px;
}

/* --- 输入框 --- */
#ai-chat-input {
    background-color: #0a0a14 !important;
    border: 1px solid rgba(201, 168, 76, 0.3) !important;
    border-radius: 8px !important;
    color: #d6cab4 !important;
    box-shadow: inset 2px 2px 8px rgba(0, 0, 0, 0.5) !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
}

#ai-chat-input:focus {
    border-color: #c9a84c !important;
    box-shadow: inset 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(201, 168, 76, 0.2) !important;
}

#ai-chat-input::placeholder {
    color: rgba(201, 168, 76, 0.4) !important;
}

#ai-chat-bottom-input {
    background: #07070f !important;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
}

/* --- 按钮美化 --- */
.chat-container .group .MuiButtonBase-root.MuiButton-root.MuiButton-text {
    background: linear-gradient(135deg, #161628, #0f0f1e) !important;
    color: #c9a84c !important;
    border: 1px solid rgba(201, 168, 76, 0.3) !important;
    border-radius: 6px !important;
    box-shadow: 1px 1px 0px #050508, inset 0 1px 0 rgba(201, 168, 76, 0.08) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: none !important;
    transition: all 0.15s ease-in-out !important;
    padding: 3px 10px !important;
    min-width: auto !important;
}

.chat-container .group .MuiButtonBase-root.MuiButton-root.MuiButton-text:hover {
    background: linear-gradient(135deg, #1e1e3a, #161628) !important;
    color: #ffd866 !important;
    border-color: #c9a84c !important;
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.25) !important;
}

/* --- 功能按钮 --- */
.flex.items-center.gap-2.pb-2 > button {
    background: linear-gradient(135deg, #161628, #0f0f1e) !important;
    color: #c9a84c !important;
    border: 1px solid rgba(201, 168, 76, 0.3) !important;
    border-radius: 8px !important;
    box-shadow: 2px 2px 0px #050508, inset 0 1px 0 rgba(201, 168, 76, 0.08) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    transition: all 0.15s ease-in-out !important;
    padding: 6px 14px !important;
}

.flex.items-center.gap-2.pb-2 > button:hover {
    background: linear-gradient(135deg, #1e1e3a, #161628) !important;
    color: #ffd866 !important;
    border-color: #c9a84c !important;
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.3) !important;
}

/* --- 加载动画 - 灵气旋转 --- */
@keyframes xiu-xian-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes xiu-xian-glow {
    0%, 100% { filter: drop-shadow(0 0 3px rgba(201, 168, 76, 0.5)); }
    50% { filter: drop-shadow(0 0 8px rgba(201, 168, 76, 0.8)); }
}

.style_dot-flashing__8L91Q.style_text__zGhNq {
    position: relative !important;
    background: transparent !important;
    width: 18px !important;
    height: 18px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    animation: xiu-xian-spin 2s linear infinite, xiu-xian-glow 1.5s ease-in-out infinite !important;
    border: 2px solid #c9a84c !important;
    border-radius: 50% !important;
    border-top-color: transparent !important;
    border-right-color: transparent !important;
}

.style_dot-flashing__8L91Q.style_text__zGhNq::before,
.style_dot-flashing__8L91Q.style_text__zGhNq::after {
    content: none !important;
    display: none !important;
}

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: '天机推演中…';
    font-size: 13px;
    color: #c9a84c;
    margin-left: 10px;
    text-shadow: 0 0 6px rgba(201, 168, 76, 0.4);
    letter-spacing: 1px;
}

/* --- 滚动条 --- */
.chat-container ::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.chat-container ::-webkit-scrollbar-track {
    background: #07070f;
    border-radius: 4px;
}

.chat-container ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b7355, #6b5344);
    border-radius: 4px;
}

.chat-container ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c9a84c, #a08040);
}