/* ========== 古风聊天框美化 ========== */

/* 隐藏默认顶部彩条 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* 统一聊天框 - 宣纸卷轴 */
.bg-gray-100\/90.relative.inline-block {
    background: 
        radial-gradient(ellipse at top left, rgba(139, 90, 43, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(139, 90, 43, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #f5ecd7 0%, #ede0c0 50%, #f5ecd7 100%) !important;
    border: 1px solid #8b5a2b !important;
    border-radius: 4px !important;
    box-shadow: 
        inset 0 0 30px rgba(139, 90, 43, 0.18),
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(139, 90, 43, 0.25) !important;
    isolation: isolate !important;
    position: relative !important;
}

/* 卷轴顶部铜杆装饰 */
.bg-gray-100\/90.relative.inline-block::before {
    content: '' !important;
    position: absolute !important;
    top: -3px !important;
    left: -3px !important;
    right: -3px !important;
    height: 6px !important;
    background: linear-gradient(180deg, #6b3410 0%, #a0651e 50%, #6b3410 100%) !important;
    border-radius: 3px !important;
    z-index: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* 卷轴底部铜杆装饰 */
.bg-gray-100\/90.relative.inline-block::after {
    content: '' !important;
    position: absolute !important;
    bottom: -3px !important;
    left: -3px !important;
    right: -3px !important;
    height: 6px !important;
    background: linear-gradient(180deg, #6b3410 0%, #a0651e 50%, #6b3410 100%) !important;
    border-radius: 3px !important;
    z-index: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* 输入聊天框 - 偏青竹冷调 */
.bg-gray-100\/90.relative.inline-block:not(.chat-answer-container .bg-gray-100\/90) {
    background: 
        radial-gradient(ellipse at top right, rgba(45, 80, 60, 0.10) 0%, transparent 55%),
        linear-gradient(135deg, #ede4cf 0%, #dcd2b4 50%, #ede4cf 100%) !important;
    border-color: #5d7a5e !important;
}

/* 主文本 - 浓墨楷体 */
.markdown-body {
    color: #2c1810 !important;
    font-family: "STKaiti", "KaiTi", "楷体", "FangSong", "仿宋", serif !important;
    font-size: 15.5px !important;
    line-height: 1.9 !important;
    letter-spacing: 0.6px !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 强调 - 朱砂红 */
.markdown-body strong, 
.markdown-body b {
    color: #a0301f !important;
    font-weight: bold !important;
}

/* 引用 - 古书批注 */
.markdown-body blockquote {
    border-left: 3px double #8b5a2b !important;
    background: rgba(139, 90, 43, 0.08) !important;
    color: #4a3520 !important;
    padding: 8px 14px !important;
    margin: 10px 0 !important;
}

/* 行内代码 */
.markdown-body code {
    background: rgba(139, 90, 43, 0.12) !important;
    color: #6b3410 !important;
    padding: 2px 6px !important;
    border-radius: 2px !important;
    border: 1px solid rgba(139, 90, 43, 0.2) !important;
}

/* 标题 - 朱墨双色 */
.markdown-body h1, 
.markdown-body h2, 
.markdown-body h3 {
    color: #4a1c1c !important;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.4) !important;
    padding-bottom: 4px !important;
    font-family: "STKaiti", "KaiTi", serif !important;
}

/* 底部按钮 - 印章质感 */
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
    color: #6b3410 !important;
    border: 1px solid rgba(139, 90, 43, 0.4) !important;
    border-radius: 2px !important;
    background: rgba(245, 236, 215, 0.6) !important;
    font-family: "KaiTi", "楷体", serif !important;
    transition: all 0.3s ease !important;
}

.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    background: rgba(160, 48, 31, 0.15) !important;
    color: #a0301f !important;
    border-color: #a0301f !important;
    box-shadow: 0 0 6px rgba(160, 48, 31, 0.3) !important;
}

/* 模型名称 */
.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: #6b3410 !important;
    font-family: "KaiTi", "楷体", serif !important;
    font-style: italic !important;
    letter-spacing: 0.5px !important;
}

/* token消耗 */
.text-orange-500 {
    color: #a0301f !important;
    font-family: "KaiTi", serif !important;
    font-weight: bold !important;
}

/* 隐藏默认loading */
.style-module__AtdJSq__dot-flashing.style-module__AtdJSq__text {
    display: none !important;
}

/* 自定义loading - 三色毛笔点墨 (SVG SMIL) */
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    min-height: 24px !important;
    min-width: 56px !important;
}

.flex.items-center.justify-center.w-6.h-5::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 56px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 24'><circle cx='12' cy='12' r='3' fill='%232c1810'><animate attributeName='r' values='2;5;2' dur='1.2s' repeatCount='indefinite' begin='0s'/><animate attributeName='opacity' values='0.4;1;0.4' dur='1.2s' repeatCount='indefinite' begin='0s'/></circle><circle cx='28' cy='12' r='3' fill='%23a0301f'><animate attributeName='r' values='2;5;2' dur='1.2s' repeatCount='indefinite' begin='0.2s'/><animate attributeName='opacity' values='0.4;1;0.4' dur='1.2s' repeatCount='indefinite' begin='0.2s'/></circle><circle cx='44' cy='12' r='3' fill='%236b3410'><animate attributeName='r' values='2;5;2' dur='1.2s' repeatCount='indefinite' begin='0.4s'/><animate attributeName='opacity' values='0.4;1;0.4' dur='1.2s' repeatCount='indefinite' begin='0.4s'/></circle></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
}

@media (max-width: 480px) {
    .markdown-body { font-size: 14.5px !important; }
}

/* ========== 古风界面整体美化 ========== */

/* === 顶部栏 - 朱漆描金 === */
.sticky.w-full.top-0.flex.items-center {
    background: 
        linear-gradient(180deg, #4a1c1c 0%, #6b2a2a 50%, #4a1c1c 100%) !important;
    border-bottom: 2px solid #c9a961 !important;
    box-shadow: 
        0 2px 0 #8b6f3a,
        0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 模型选择器 */
#ai-model-selector .group.flex.items-center {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.18) 0%, rgba(201, 169, 97, 0.05) 100%) !important;
    border: 1px solid rgba(201, 169, 97, 0.45) !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
}

#ai-model-selector .group.flex.items-center:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.32) 0%, rgba(201, 169, 97, 0.12) 100%) !important;
    border-color: #c9a961 !important;
    box-shadow: 0 0 8px rgba(201, 169, 97, 0.4) !important;
}

#ai-model-selector .truncate.text-\[13px\] {
    color: #f4e9c5 !important;
    font-family: "KaiTi", "楷体", "STKaiti", serif !important;
    letter-spacing: 1px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

#ai-model-selector .shrink-0.flex.items-center svg {
    color: #c9a961 !important;
}

/* 顶部栏图标统一调金色 */
.sticky.w-full.top-0 svg.lucide-clock-8,
.sticky.w-full.top-0 button.MuiIconButton-root svg.lucide-music-2 {
    color: #c9a961 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
}

.sticky.w-full.top-0 svg:has(use[href="#icon-icon-set"]) {
    color: #c9a961 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
}

.sticky.w-full.top-0 span.MuiBadge-dot.md\:hidden {
    background-color: #ff4d4f !important;
    box-shadow: 0 0 8px #ff4d4f !important;
}

#header-setting-button {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.18) 0%, rgba(201, 169, 97, 0.05) 100%) !important;
    border: 1px solid rgba(201, 169, 97, 0.45) !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
}

#header-setting-button:hover {
    background: rgba(201, 169, 97, 0.32) !important;
    border-color: #f4d670 !important;
}

#header-setting-button svg {
    color: #f4e9c5 !important;
}

/* === 开场白选择器 === */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
    background: linear-gradient(135deg, #f5ecd7 0%, #ede0c0 100%) !important;
    border: 1px solid #8b5a2b !important;
    border-radius: 2px !important;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"]:hover {
    border-color: #a0301f !important;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(160, 48, 31, 0.3) !important;
}

div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="SlidersH"] {
    color: #6b3410 !important;
}

div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="ChevronDown"] {
    color: #a0301f !important;
}

/* === 按钮栏 - 玄漆嵌金 === */
#ai-mod-button2 button.MuiButton-root {
    background: linear-gradient(135deg, #6b2a2a 0%, #4a1c1c 100%) !important;
    border: 1px solid #c9a961 !important;
    border-radius: 2px !important;
    color: #f4e9c5 !important;
    font-family: "KaiTi", "楷体", serif !important;
    letter-spacing: 1px !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 4px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

#ai-mod-button2 button.MuiButton-root:hover {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2a2a 100%) !important;
    border-color: #f4d670 !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 4px 10px rgba(244, 214, 112, 0.3) !important;
}

#ai-mod-button2 button.MuiButton-root svg {
    color: #c9a961 !important;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)) !important;
}

/* === 底部栏 === */
.bg-gradient-to-t {
    background: linear-gradient(180deg, transparent 0%, rgba(74, 28, 0.05) 50%, rgba(74, 28, 28, 0.18) 100%) !important;
}

#ai-chat-bottom-input {
    background: linear-gradient(135deg, #f5ecd7 0%, #ede0c0 100%) !important;
    border: 1.5px solid #8b5a2b !important;
    border-radius: 4px !important;
    box-shadow: 
        inset 0 0 20px rgba(139, 90, 43, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

#ai-chat-input {
    color: #2c1810 !important;
    font-family: "KaiTi", "楷体", "STKaiti", serif !important;
    font-size: 15px !important;
    letter-spacing: 0.5px !important;
    background: transparent !important;
}

#ai-chat-input::placeholder {
    color: rgba(107, 52, 16, 0.55) !important;
    font-family: "KaiTi", "楷体", serif !important;
    font-style: italic !important;
}

#ai-chat-input::selection {
    background: rgba(160, 48, 31, 0.3) !important;
    color: #2c1810 !important;
}

/* === 分页栏 - 仅颜色与视觉，不动布局 === */
.MuiPaginationItem-root {
    color: #6b3410 !important;
    background: linear-gradient(135deg, #f5ecd7 0%, #ede0c0 100%) !important;
    border: 1px solid #8b5a2b !important;
    font-family: "KaiTi", "楷体", serif !important;
    transition: all 0.3s ease !important;
}

.MuiPaginationItem-root:hover {
    background: linear-gradient(135deg, #ede0c0 0%, #ddc89e 100%) !important;
    border-color: #a0301f !important;
    color: #a0301f !important;
}

.MuiPaginationItem-root.Mui-selected {
    background: linear-gradient(135deg, #a0301f 0%, #6b1f14 100%) !important;
    color: #f4e9c5 !important;
    border-color: #c9a961 !important;
    box-shadow: 0 0 6px rgba(160, 48, 31, 0.5) !important;
}

.MuiPaginationItem-root.Mui-disabled {
    opacity: 0.4 !important;
}

.MuiPaginationItem-icon {
    color: inherit !important;
}

.MuiStack-root.css-1uwir8f .MuiBox-root {
    color: #6b3410 !important;
    font-family: "KaiTi", serif !important;
}

.MuiInputBase-input {
    color: #2c1810 !important;
    background: rgba(245, 236, 215, 0.6) !important;
    font-family: "KaiTi", serif !important;
    border-radius: 2px !important;
}

/* === 评论区 === */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background: 
        radial-gradient(ellipse at top, rgba(139, 90, 43, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #f5ecd7 0%, #ede0c0 100%) !important;
    border-top: 2px solid #8b5a2b !important;
}

/* 评论区标题 */
div.text-lg.font-bold {
    color: #4a1c1c !important;
    font-family: "STKaiti", "KaiTi", "楷体", serif !important;
    letter-spacing: 2px !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    border-bottom: 1px dashed rgba(139, 90, 43, 0.4) !important;
}

p.MuiTypography-body1.text-grey-600 {
    color: #6b3410 !important;
    font-family: "KaiTi", serif !important;
}

/* 评分 */
span.MuiRating-iconEmpty svg {
    color: rgba(139, 90, 43, 0.35) !important;
}

span.MuiRating-iconFilled svg {
    color: #d4a017 !important;
    filter: drop-shadow(0 0 3px rgba(212, 160, 23, 0.5)) !important;
}

span.text-orange-500 {
    color: #a0301f !important;
    font-family: "KaiTi", serif !important;
    font-weight: bold !important;
}

/* 评论输入框 */
div.flex.flex-col.border-gray-200 {
    background: rgba(245, 236, 215, 0.65) !important;
    border: 1px solid #8b5a2b !important;
    border-radius: 2px !important;
    box-shadow: inset 0 1px 3px rgba(139, 90, 43, 0.12) !important;
}

textarea.rc-textarea {
    color: #2c1810 !important;
    font-family: "KaiTi", "楷体", serif !important;
    background: transparent !important;
}

textarea.rc-textarea::placeholder {
    color: rgba(107, 52, 16, 0.5) !important;
    font-style: italic !important;
}

div.bg-gray-100.text-gray-500 {
    background: rgba(139, 90, 43, 0.12) !important;
    color: #6b3410 !important;
    border-radius: 2px !important;
}

/* 发送按钮 - 朱印 */
div.cursor-pointer.group.flex.items-center.justify-center {
    background: linear-gradient(135deg, #a0301f 0%, #6b1f14 100%) !important;
    border: 1px solid #c9a961 !important;
    border-radius: 2px !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 6px rgba(160, 48, 31, 0.4) !important;
    transition: all 0.3s ease !important;
}

div.cursor-pointer.group.flex.items-center.justify-center:hover {
    background: linear-gradient(135deg, #c43d27 0%, #8b2a1a 100%) !important;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 12px rgba(196, 61, 39, 0.5) !important;
}

div[data-state="closed"] svg[data-icon="Send03"] {
    color: #f4e9c5 !important;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)) !important;
}

/* 分割线 */
div.style_divider__mW0YX {
    border-top: 1px dashed #8b5a2b !important;
    background: transparent !important;
}

/* 排序按钮 */
button.MuiButton-containedPrimary {
    background: linear-gradient(135deg, #a0301f 0%, #6b1f14 100%) !important;
    color: #f4e9c5 !important;
    border: 1px solid #c9a961 !important;
    border-radius: 2px !important;
    font-family: "KaiTi", serif !important;
    box-shadow: 0 2px 4px rgba(160, 48, 31, 0.3) !important;
}

button.MuiButton-outlinedPrimary {
    background: rgba(245, 236, 215, 0.6) !important;
    color: #6b3410 !important;
    border: 1px solid #8b5a2b !important;
    border-radius: 2px !important;
    font-family: "KaiTi", serif !important;
}

button.MuiButton-outlinedPrimary:hover {
    background: rgba(139, 90, 43, 0.18) !important;
    border-color: #a0301f !important;
    color: #a0301f !important;
}

/* 评论项 */
div.group.ml-0 {
    background: rgba(255, 252, 240, 0.55) !important;
    border: 1px solid rgba(139, 90, 43, 0.22) !important;
    border-radius: 2px !important;
    transition: all 0.3s ease !important;
}

div.group.ml-0:hover {
    background: rgba(255, 252, 240, 0.85) !important;
    border-color: rgba(139, 90, 43, 0.45) !important;
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.12) !important;
}

div.group img.rounded-full {
    border: 2px solid #c9a961 !important;
    box-shadow: 0 0 0 1px #8b5a2b !important;
}

div.text-sm.text-grey-600 span.font-bold {
    color: #4a1c1c !important;
    font-family: "KaiTi", serif !important;
    letter-spacing: 1px !important;
}

span.text-\[10px\] {
    color: #a0301f !important;
    background: rgba(160, 48, 31, 0.1) !important;
    padding: 1px 5px !important;
    border-radius: 2px !important;
    border: 1px solid rgba(160, 48, 31, 0.35) !important;
    font-family: "KaiTi", serif !important;
}

div.break-all {
    color: #2c1810 !important;
    font-family: "KaiTi", "楷体", serif !important;
    line-height: 1.8 !important;
}

div.text-xs.text-grey-600 {
    color: rgba(107, 52, 16, 0.7) !important;
    font-family: "KaiTi", serif !important;
    font-style: italic !important;
}

button.text-gray-400 {
    color: #6b3410 !important;
    transition: all 0.3s ease !important;
}

button.text-gray-400:hover {
    color: #a0301f !important;
    transform: scale(1.1) !important;
}

button.text-gray-400 svg {
    color: inherit !important;
}

span.cursor-pointer {
    color: #a0301f !important;
    font-family: "KaiTi", serif !important;
    transition: all 0.3s ease !important;
}

span.cursor-pointer:hover {
    color: #c43d27 !important;
    text-decoration: underline !important;
}

div.ml-8.border-l {
    border-left: 2px solid #c9a961 !important;
    background: rgba(201, 169, 97, 0.06) !important;
}
div.group.ml-0:has(span.text-\[10px\]) div.text-sm.text-grey-600 span.font-bold {
    color: #b8860b !important;
    text-shadow: 0 0 4px rgba(184, 134, 11, 0.3) !important;
}
.sticky.w-full.top-0.flex.items-center::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important; right: 0 !important; top: 0 !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, #f4d670, transparent) !important;
}
div.cursor-pointer.group.flex.items-center.justify-center:hover {
    animation: seal-pulse 1.4s ease-in-out infinite !important;
}
@keyframes seal-pulse {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 12px rgba(196,61,39,0.5); }
    50%      { box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 18px rgba(196,61,39,0.75); }
}