/* =============================================
   [旧城余温 / Lingering Heat of the Old City]
   主题风格：禁忌刺激、老城区住宅、水墨中性
   base-hue:35  base-sat:15%  is-dark:0  accent-hue:25  accent-sat:60%

   bg-deep:hsl(35, 15%, 93%)    bg-default:hsl(35, 15%, 96%)   bg-paper:#fdfdfd
   text-main:#2c1a05            text-sub:#4a2c08               text-muted:rgba(120,80,20,0.5)
   border:rgba(120,80,20,0.2)   accent:#8b5e1a                 accent-dim:rgba(120,80,20,0.14)
   glow: 0 0 14px rgba(80,50,10,0.08)

   亮点① blockquote → 模拟旧建筑墙缝，深色重纹理左边框，营造压抑感。
   亮点② 加载动画  → 模拟旧楼道感应灯明灭效果（SVG SMIL）。
   亮点③ 分隔线    → 渐变消失纹理，带有点状核心，暗示窥探视角。
   ============================================= */

/* ===== 1. 危险区域：基础覆盖与强制可见 ===== */
/* 隐藏默认装饰条 */
[class*="bg-[#F1CBCB]"], [class*="bg-[#c9e1e9]"] { display: none !important; }

/* 代码块美化 */
.markdown-body pre { 
    background: rgba(228,218,200,1) !important; 
    border: 1px solid rgba(120,80,20,0.45) !important; 
    border-left: 3px solid #8b5e1a !important; 
    border-radius: 6px; 
    padding: 1em 1.2em; 
    overflow-x: auto; 
}
.markdown-body pre code { 
    background: transparent !important; 
    color: #1a0e03 !important; 
    font-family: 'Courier New', Courier, monospace !important;
}
.markdown-body :not(pre)>code { 
    background: rgba(120,80,20,0.14) !important; 
    color: #5a3408 !important; 
    padding: 0.15em 0.45em; 
    border-radius: 4px; 
}

/* details 折叠块 */
details { 
    background: rgba(0,0,0,0.03) !important; 
    border: 1px solid rgba(120,80,20,0.18) !important; 
    border-radius: 6px; 
    margin: 8px 0; 
    overflow: hidden; 
    transition: border-color 0.15s; 
}
details[open] { border-color: rgba(120,80,20,0.45) !important; }
details summary { 
    background: rgba(0,0,0,0.06) !important; 
    color: #6b3a0f !important; 
    padding: 8px 12px 8px 32px; 
    display: block; 
    position: relative; 
    border-bottom: 1px solid rgba(136,136,136,0.15) !important; 
    cursor: pointer; 
    font-weight: 600; 
    list-style: none; 
    user-select: none; 
}
details summary::before { 
    content: '\25B6'; 
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #8b5e1a !important; 
    font-size: 11px; 
    transition: transform 0.2s ease; 
}
details[open] summary::before { transform: translateY(-50%) rotate(90deg); }
details summary::-webkit-details-marker { display: none; }
details .content { color: #3c240a !important; padding: 12px; }

/* 滚动条 */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: #f2eee9 !important; }
::-webkit-scrollbar-thumb { background: #a06828 !important; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8b5e1a !important; }

/* 选区与占位符 */
::placeholder { color: rgba(120,80,20,0.3) !important; opacity: 1; }
::selection { background: rgba(120,80,20,0.14) !important; color: #5a3408 !important; }

/* 输入框强制可见（核心安全项） */
#ai-chat-input { 
    background: rgba(250,246,238,0.95) !important; 
    color: #2c1a05 !important; 
    caret-color: #8b5e1a !important; 
}
textarea.rc-textarea { 
    background: rgba(250,246,238,0.95) !important; 
    color: #2c1a05 !important; 
    border: 1px solid rgba(120,80,20,0.22) !important; 
}

/* ===== 2. 全局与布局 ===== */
body, #root, .h-screen { 
    background-color: #fdfdfd !important; 
    color: #2c1a05 !important; 
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
}

/* ===== 3. 顶部导航 ===== */
.sticky.w-full.top-0.flex.items-center { 
    background: rgba(245,240,232,0.95) !important; 
    border-bottom: 1px solid rgba(120,80,20,0.15) !important; 
    backdrop-filter: blur(12px) !important; 
}
#ai-model-selector .group.flex.items-center { 
    background: rgba(120,80,20,0.06) !important; 
    border: 1px solid rgba(120,80,20,0.22) !important; 
    border-radius: 6px;
}
#ai-model-selector .truncate.text-[13px] { color: #6b3a0f !important; }
#ai-model-selector .shrink-0.flex.items-center svg { color: #8b5e1a !important; }
#header-setting-button { color: #6b3a0f !important; }

/* 开场白区域 */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
    background: rgba(120,80,20,0.06) !important;
    border-color: rgba(120,80,20,0.18) !important;
}

/* ===== 4. 聊天气泡与正文 ===== */
/* 基准气泡 */
.bg-gray-100\/90.relative.inline-block { 
    background-color: #f5f0e8 !important; 
    border: 1px solid rgba(120,80,20,0.2) !important; 
    border-radius: 4px !important;
    padding: 10px 14px !important;
    box-shadow: 0px 0px 0px rgba(80,50,10,0.08) !important;
}
/* 交替背景色 */
.chat-answer-container .bg-gray-100\/90.relative.inline-block {
    background-color: #ede4d0 !important;
}

/* Markdown 正文控制 */
.markdown-body { 
    color: #2c1a05 !important; 
    font-size: 14px !important; 
    line-height: 1.8 !important; 
    letter-spacing: 0.02em !important;
}
.markdown-body strong { color: #6b3a0f !important; font-weight: 700 !important; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { 
    color: #6b3a0f !important; 
    border-bottom: 1px solid rgba(120,80,20,0.15) !important;
    padding-bottom: 0.3em !important;
}

/* 亮点①：引用块氛围 */
.markdown-body blockquote { 
    border-left: 4px solid rgba(120,80,20,0.5) !important; 
    background: rgba(0,0,0,0.03) !important; 
    color: #4a2c08 !important; 
    padding: 8px 16px !important; 
    margin: 12px 0 !important;
    font-style: italic !important;
    position: relative;
}

/* ===== 5. 加载动画（亮点②） ===== */
.style_dot-flashing__8L91Q.style_text__zGhNq { display: none !important; }
.flex.items-center.justify-center.w-6.h-5 { position: relative; }
.flex.items-center.justify-center.w-6.h-5::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: #8b5e1a !important;
    border-radius: 50%;
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%238b5e1a'%3E%3Canimate attributeName='opacity' values='1;0.2;1' dur='1.5s' repeatCount='indefinite' /%3E%3C/circle%3E%3C/svg%3E");
    background-size: contain;
}

/* ===== 6. 底部输入区 ===== */
.bg-gradient-to-t { background: transparent !important; }
#ai-chat-bottom-input { 
    background: rgba(245,240,232,0.98) !important; 
    border-top: 1px solid rgba(120,80,20,0.15) !important;
}
#ai-chat-input {
    border-radius: 14px !important;
    border: 1px solid rgba(120,80,20,0.22) !important;
    padding: 10px 16px !important;
}
#ai-chat-input:focus {
    border-color: rgba(120,80,20,0.48) !important;
    box-shadow: 0 0 0 2px rgba(120,80,20,0.05) !important;
}
#ai-send-button {
    background: linear-gradient(135deg, #7c4a10 0%, #5a3408 100%) !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #f5f0e8 !important;
}

/* ===== 7. 评论区与交互 ===== */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] { background: #fdfdfd !important; }
div.text-lg.font-bold { color: #6b3a0f !important; }
p.MuiTypography-body1.text-grey-600 { color: #4a2c08 !important; }

/* 星级评价 */
span.MuiRating-iconEmpty svg { color: rgba(120,80,20,0.3) !important; }
span.MuiRating-iconFilled svg { color: #8b5e1a !important; }
span.text-orange-500 { color: #8b5e1a !important; }

/* 亮点③：分隔线装饰 */
.style_divider__mW0YX {
    height: 1px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(120,80,20,0.3) 50%, transparent 100%) !important;
    margin: 24px 0 !important;
    position: relative !important;
}
.style_divider__mW0YX::after {
    content: "◈";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fdfdfd !important;
    padding: 0 8px;
    color: rgba(120,80,20,0.4) !important;
    font-size: 10px;
}

/* 评论卡片 */
div.flex.flex-col.border-gray-200 { 
    border-color: rgba(120,80,20,0.1) !important; 
    background: rgba(120,80,20,0.02) !important;
    padding: 12px !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
}

/* ===== 8. MUI 全局组件适配 ===== */
.MuiButton-containedPrimary {
    background: #7c4a10 !important;
    color: #f5f0e8 !important;
    border-radius: 6px !important;
}
.MuiButton-outlinedPrimary {
    border-color: rgba(120,80,20,0.4) !important;
    color: #6b3a0f !important;
    border-radius: 6px !important;
}
.MuiPaginationItem-root.Mui-selected {
    background-color: #8b5e1a !important;
    color: #f5f0e8 !important;
}
.MuiPaginationItem-root:hover {
    background-color: rgba(120,80,20,0.1) !important;
}

/* 侧边栏 */
.shadow-lg.border-r.border-gray-200 {
    background: #f5f0e8 !important;
    border-right: 1px solid rgba(120,80,20,0.15) !important;
}
.conversation-text { color: #2c1a05 !important; }

/* ===== 9. 响应式与降速兜底 ===== */
@media (max-width: 480px) {
    .bg-gray-100\/90.relative.inline-block { max-width: 90% !important; }
}

@media (prefers-reduced-motion: reduce) {
    .flex.items-center.justify-center.w-6.h-5::before {
        animation: none !important;
    }
}