/* ===== 5黄毛模拟器 · 全界面暗紫魅魔主题（AI字体加深修正版） ===== */

/* ========== 全局背景：暗紫渐变 ========== */
html,
body,
#app,
#root,
[class*="container"],
[class*="wrapper"],
[class*="layout"],
[class*="page"],
[class*="main"] {
    background:
        radial-gradient(circle at 20% 20%, rgba(180, 30, 200, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 100, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(60, 0, 100, 0.15) 0%, transparent 70%),
        #0a0012 !important;
    color: #c8b8e0 !important;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
}

/* ========== 顶部标题栏 ========== */
[class*="header"],
[class*="navbar"],
[class*="title-bar"],
[class*="top-bar"],
header {
    background:
        linear-gradient(to bottom, rgba(60, 10, 120, 0.85), rgba(20, 0, 50, 0.9)) !important;
    border-bottom: 1.5px solid rgba(155, 48, 255, 0.5) !important;
    box-shadow: 0 2px 15px rgba(100, 0, 150, 0.3) !important;
    backdrop-filter: blur(8px) !important;
}

/* ========== 聊天消息容器 ========== */
[class*="chat"],
[class*="message"],
[class*="conversation"],
[class*="dialogue"],
[class*="thread"] {
    background: transparent !important;
}

/* ========== 用户消息气泡 ========== */
[class*="user"][class*="message"],
[class*="user"][class*="bubble"],
[class*="human"][class*="message"],
[class*="right"][class*="message"],
[class*="sent"] {
    background:
        linear-gradient(135deg, rgba(114, 9, 183, 0.6), rgba(58, 12, 163, 0.7)) !important;
    border: 1px solid rgba(155, 48, 255, 0.4) !important;
    border-radius: 12px !important;
    color: #e8d5f5 !important;
    box-shadow: 0 2px 10px rgba(100, 0, 150, 0.25) !important;
    padding: 10px 14px !important;
}

/* ========== AI回复消息气泡 ========== */
[class*="ai"][class*="message"],
[class*="bot"][class*="message"],
[class*="assistant"][class*="message"],
[class*="left"][class*="message"],
[class*="received"] {
    background:
        linear-gradient(135deg, rgba(26, 0, 54, 0.7), rgba(13, 0, 26, 0.8)) !important;
    border: 1px solid rgba(72, 9, 183, 0.4) !important;
    border-radius: 12px !important;
    color: #a88bd6 !important;  /* ✅ 加深：原 #c8b8e0 → #a88bd6 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    padding: 10px 14px !important;
}

/* ========== AI回复消息气泡 - 用聊天框选择器精准覆盖 ========== */
.bg-gray-100\\/90.relative.inline-block {
    background:
        radial-gradient(circle at 30% 20%, rgba(180, 30, 200, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 0, 100, 0.08) 0%, transparent 50%),
        #0d001a !important;
    border: 2px solid #9b30ff !important;
    border-radius: 10px !important;
    outline: 1.5px solid rgba(255, 50, 150, 0.30) !important;
    outline-offset: 2px !important;
    box-shadow:
        inset 0 0 20px rgba(155, 48, 255, 0.15),
        0 0 15px rgba(200, 0, 150, 0.20),
        0 4px 10px rgba(0, 0, 0, 0.35) !important;
    padding: 14px 16px !important;
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    color: #a88bd6 !important;  /* ✅ 加深 */
}

.bg-gray-100\\/90.relative.inline-block:hover {
    border-color: #cc44ff !important;
    outline-color: rgba(255, 80, 180, 0.50) !important;
    box-shadow:
        inset 0 0 30px rgba(155, 48, 255, 0.25),
        0 0 25px rgba(220, 0, 160, 0.30) !important;
}

/* 角花装饰：左上 */
.bg-gray-100\\/90.relative.inline-block::before {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    opacity: 0.14 !important;
    pointer-events: none !important;
    width: 65px !important;
    height: 65px !important;
    top: 6px !important;
    left: 6px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M15 85 Q20 50 45 20 Q55 8 60 15 Q50 30 55 50 Q58 65 35 70 Q20 75 15 85 Z' fill='none' stroke='%23cc33ff' stroke-width='2.5'/><path d='M70 10 Q75 8 80 12 Q72 25 60 35' fill='none' stroke='%23cc33ff' stroke-width='1.8'/><circle cx='55' cy='42' r='3' fill='%23ff3399' opacity='0.7'/></svg>") !important;
}

/* 角花装饰：右下 */
.bg-gray-100\\/90.relative.inline-block::after {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    opacity: 0.14 !important;
    pointer-events: none !important;
    width: 65px !important;
    height: 65px !important;
    bottom: 6px !important;
    right: 6px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M85 15 Q80 50 55 80 Q45 92 40 85 Q50 70 45 50 Q42 35 65 30 Q80 25 85 15 Z' fill='none' stroke='%23ff3399' stroke-width='2.5'/><path d='M30 90 Q25 92 20 88 Q28 75 40 65' fill='none' stroke='%23ff3399' stroke-width='1.8'/><circle cx='45' cy='58' r='3' fill='%23cc33ff' opacity='0.7'/></svg>") !important;
}

/* 正文 */
.markdown-body {
    background: transparent !important;
    z-index: 1 !important;
    color: #a88bd6 !important;  /* ✅ 加深正文 */
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.8 !important;
    letter-spacing: 0.02em;
}
.markdown-body strong,
.markdown-body b {
    color: #ff55aa !important;
    text-shadow: 0 0 6px rgba(255, 50, 150, 0.35);
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: #ddc0ff !important;
    border-bottom: 1px solid rgba(155, 48, 255, 0.4) !important;
}
.markdown-body a {
    color: #bb88ff !important;
    border-bottom: 1px dotted #9b30ff !important;
}
.markdown-body a:hover {
    color: #ff55aa !important;
    border-bottom-color: #ff55aa !important;
}

/* Token 消耗 */
.text-orange-500 {
    color: #ff3399 !important;
    font-weight: bold !important;
    text-shadow: 0 0 8px rgba(255, 0, 120, 0.4);
}

/* ========== 输入框区域 ========== */
[class*="input"],
[class*="textarea"],
[class*="composer"],
[class*="editor"] {
    background: rgba(13, 0, 26, 0.8) !important;
    border: 1.5px solid rgba(155, 48, 255, 0.4) !important;
    border-radius: 10px !important;
    color: #e8d5f5 !important;
    box-shadow: inset 0 0 10px rgba(100, 0, 150, 0.15) !important;
}

[class*="input"]:focus,
[class*="textarea"]:focus {
    border-color: #cc44ff !important;
    box-shadow: inset 0 0 15px rgba(155, 48, 255, 0.25), 0 0 12px rgba(200, 0, 150, 0.25) !important;
    outline: none !important;
}

/* ========== 按钮 ========== */
[class*="button"],
[class*="btn"] {
    background: linear-gradient(135deg, #3a0ca3, #7209b7) !important;
    color: #ffd166 !important;
    border: 1px solid rgba(155, 48, 255, 0.5) !important;
    border-radius: 8px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
}

[class*="button"]:hover,
[class*="btn"]:hover {
    background: linear-gradient(135deg, #7209b7, #9d4edd) !important;
    box-shadow: 0 0 15px rgba(200, 0, 150, 0.40) !important;
    border-color: #cc44ff !important;
}

/* ========== 底部按钮与辅助文字 ========== */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary,
.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: #bb88ff !important;
    font-weight: bold !important;
    z-index: 1 !important;
}

/* ========== 状态栏 Details/Summary ========== */
details {
    background:
        radial-gradient(circle at 30% 20%, rgba(180, 30, 200, 0.08) 0%, transparent 50%),
        #0d001a !important;
    border: 1.5px solid rgba(155, 48, 255, 0.45) !important;
    border-radius: 10px !important;
    box-shadow:
        inset 0 0 15px rgba(155, 48, 255, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.30) !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
    position: relative !important;
    isolation: isolate !important;
    transition: all 0.3s ease !important;
    color: #a88bd6 !important;  /* ✅ 加深折叠块文字 */
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
    line-height: 1.7 !important;
}

details[open] {
    border-color: #9b30ff !important;
    box-shadow:
        inset 0 0 20px rgba(155, 48, 255, 0.15),
        0 0 15px rgba(200, 0, 150, 0.20) !important;
}

details:hover {
    border-color: #cc44ff !important;
    box-shadow:
        inset 0 0 25px rgba(155, 48, 255, 0.12),
        0 0 18px rgba(200, 0, 150, 0.20) !important;
}

details > summary {
    background: linear-gradient(to right, #3a0ca3, #7209b7) !important;
    color: #ffd166 !important;
    padding: 12px 18px !important;
    font-weight: bold !important;
    font-size: 1.05em !important;
    cursor: pointer !important;
    list-style: none !important;
    position: relative !important;
    border-bottom: 1px solid transparent !important;
    transition: all 0.3s ease !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

details > summary::-webkit-details-marker {
    display: none !important;
}

details > summary:hover {
    background: linear-gradient(to right, #7209b7, #9d4edd) !important;
    color: #ffffff !important;
}

details[open] > summary {
    background: linear-gradient(to right, #7209b7, #f72585) !important;
    border-bottom: 1px solid #f72585 !important;
}

details > summary::after {
    content: "" !important;
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 6px solid transparent !important;
    border-right: 6px solid transparent !important;
    border-top: 8px solid #ffd166 !important;
    transition: transform 0.3s ease !important;
}

details[open] > summary::after {
    transform: translateY(-50%) rotate(180deg) !important;
    border-top-color: #ffffff !important;
}

details > div,
details > *:not(summary) {
    padding: 14px !important;
    background-color: rgba(13, 0, 26, 0.7) !important;
}

details::before {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    opacity: 0.10 !important;
    pointer-events: none !important;
    width: 55px !important;
    height: 55px !important;
    top: 6px !important;
    left: 6px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M15 85 Q20 50 45 20 Q55 8 60 15 Q50 30 55 50 Q58 65 35 70 Q20 75 15 85 Z' fill='none' stroke='%23cc33ff' stroke-width='2.5'/><circle cx='55' cy='42' r='3' fill='%23ff3399' opacity='0.6'/></svg>") !important;
}

details::after {
    content: "" !important;
    position: absolute !important;
    z-index: -1 !important;
    opacity: 0.10 !important;
    pointer-events: none !important;
    width: 55px !important;
    height: 55px !important;
    bottom: 6px !important;
    right: 6px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M85 15 Q80 50 55 80 Q45 92 40 85 Q50 70 45 50 Q42 35 65 30 Q80 25 85 15 Z' fill='none' stroke='%23ff3399' stroke-width='2.5'/><circle cx='45' cy='58' r='3' fill='%23cc33ff' opacity='0.6'/></svg>") !important;
}

details strong,
details b {
    color: #ff55aa !important;
    text-shadow: 0 0 5px rgba(255, 50, 150, 0.3);
}

details h1,
details h2,
details h3,
details h4 {
    color: #ddc0ff !important;
    border-bottom: 1px solid rgba(155, 48, 255, 0.4) !important;
}

details a {
    color: #bb88ff !important;
    border-bottom: 1px dotted #9b30ff !important;
}

details li::marker {
    color: #9b30ff !important;
}

details table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1em 0 !important;
}

details th {
    background-color: rgba(114, 9, 183, 0.5) !important;
    color: #ffd166 !important;
    padding: 8px !important;
    border: 1px solid rgba(155, 48, 255, 0.4) !important;
}

details td {
    padding: 8px !important;
    border: 1px solid rgba(155, 48, 255, 0.3) !important;
    background-color: rgba(26, 0, 54, 0.4) !important;
}

/* 状态图标 */
.status-icon {
    display: inline-block !important;
    margin-right: 4px !important;
    font-size: 1.1em !important;
    filter: drop-shadow(0 0 3px rgba(247, 37, 133, 0.5)) !important;
    animation: demon-pulse 2s infinite ease-in-out !important;
}

@keyframes demon-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; transform: scale(1.08); }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px !important;
}
::-webkit-scrollbar-track {
    background: rgba(13, 0, 26, 0.5) !important;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #7209b7, #3a0ca3) !important;
    border-radius: 4px !important;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #9d4edd, #7209b7) !important;
}

/* 移动端 */
@media (max-width: 480px) {
    .bg-gray-100\\/90.relative.inline-block::before,
    .bg-gray-100\\/90.relative.inline-block::after {
        width: 40px !important;
        height: 40px !important;
    }
    details::before,
    details::after {
        width: 40px !important;
        height: 40px !important;
    }
}

/* ===== ++++ 聊天对话栏紫色边框 ++++ ===== */
[class*="chat"]:not([class*="input"]):not([class*="composer"]),
[class*="conversation"],
[class*="message-list"] {
    border: 2px solid #9b30ff !important;
    border-radius: 14px !important;
    box-shadow: 0 0 20px rgba(155, 48, 255, 0.15) !important;
}