/* ============================================================ */
/* 武动乾坤 · 天玄古境 — builtInCss                              */
/* is-dark=0 | base-hue=32 base-sat=14% | accent-hue=40 accent-sat=76% */
/* bg-deep     hsl(32,14%,95%) | bg-default  hsl(32,14%,92%)  */
/* bg-paper    hsl(32,14%,99%) | bg-raised   hsl(32,14%,87%)  */
/* bg-hover    hsl(32,14%,81%) | text-main   hsl(32,8%,7%)    */
/* text-sub    hsl(32,6%,34%)  | text-muted  hsl(32,5%,55%)   */
/* border      hsl(32,14%,79%) | accent      hsl(40,76%,31%)  */
/* accent-dim  hsl(40,26.6%,90%)| accent-text hsl(40,60.8%,22%)*/
/* ============================================================ */

/* §0 ─ 危险区域（最高优先级）*/
[class*="bg-[#F1CBCB]"],
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

.markdown-body pre {
    background: hsl(32,14%,96%) !important;
    border: 1px solid hsl(32,14%,79%) !important;
    border-left: 3px solid hsl(40,76%,31%) !important;
    border-radius: 6px !important;
    padding: 0.9em 1.1em !important;
    overflow-x: auto !important;
    font-size: 0.87rem !important;
    line-height: 1.7 !important;
}
.markdown-body pre code {
    background: transparent !important;
    color: hsl(32,8%,7%) !important;
}
.markdown-body :not(pre) > code {
    background: hsl(40,26.6%,90%) !important;
    color: hsl(40,60.8%,22%) !important;
    padding: 0.12em 0.42em !important;
    border-radius: 4px !important;
}

details {
    background: hsl(32,14%,99%) !important;
    border: 1px solid hsl(32,14%,79%) !important;
    border-radius: 8px !important;
    margin: 6px 0 !important;
    overflow: hidden !important;
    transition: border-color 0.15s !important;
}
details[open] {
    border-color: hsl(40,76%,31%) !important;
}
details summary {
    background: hsl(32,14%,87%) !important;
    color: hsl(32,8%,7%) !important;
    padding: 7px 12px 7px 30px !important;
    display: block !important;
    position: relative !important;
    border-bottom: 1px solid hsl(32,14%,79%) !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.04em !important;
    list-style: none !important;
    user-select: none !important;
}
details summary::before {
    content: '▶' !important;
    position: absolute !important;
    left: 11px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: hsl(40,76%,31%) !important;
    font-size: 10px !important;
    transition: transform 0.2s ease !important;
}
details[open] summary::before {
    transform: translateY(-50%) rotate(90deg) !important;
}
details summary::-webkit-details-marker {
    display: none !important;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: hsl(32,14%,92%) !important; }
::-webkit-scrollbar-thumb { background: hsl(40,50%,60%) !important; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: hsl(40,76%,31%) !important; }

::placeholder {
    color: hsl(32,5%,55%) !important;
    opacity: 1 !important;
}
::selection {
    background: hsl(40,26.6%,88%) !important;
    color: hsl(40,60.8%,22%) !important;
}

#ai-chat-input {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
    caret-color: hsl(40,76%,31%) !important;
}
textarea.rc-textarea {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
    border: 1px solid hsl(32,14%,79%) !important;
}

/* §1 ─ 全局与布局 */
body, #root, .h-screen {
    background: hsl(32,14%,92%) !important;
    color: hsl(32,8%,7%) !important;
}

/* §2 ─ 顶部导航栏 */
.sticky.w-full.top-0.flex.items-center {
    background: hsl(32,14%,99%) !important;
    border-bottom: 1px solid hsl(32,14%,79%) !important;
}
#ai-model-selector .group.flex.items-center {
    color: hsl(32,8%,7%) !important;
}
#ai-model-selector .truncate.text-\[13px\] {
    color: hsl(32,6%,34%) !important;
}
#ai-model-selector .shrink-0.flex.items-center svg {
    fill: hsl(32,5%,55%) !important;
}
#header-setting-button {
    color: hsl(32,5%,55%) !important;
}
#header-setting-button:hover {
    color: hsl(40,76%,31%) !important;
}

/* §3 ─ 开场白区域 */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"] {
    background: hsl(32,14%,87%) !important;
    border-color: hsl(32,14%,79%) !important;
    color: hsl(32,8%,7%) !important;
}
div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="SlidersH"] {
    fill: hsl(32,5%,55%) !important;
}
div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="ChevronDown"] {
    fill: hsl(32,5%,55%) !important;
}

/* §4 ─ 侧边栏 */
.shadow-lg.border-r.border-gray-200 {
    background: hsl(32,14%,99%) !important;
    border-color: hsl(32,14%,79%) !important;
}
.MuiList-root {
    background: transparent !important;
    color: hsl(32,8%,7%) !important;
}
.conversation-text {
    color: hsl(32,6%,34%) !important;
}

/* §5 ─ 功能按钮 */
#ai-mod-button2 button.MuiButton-root {
    background: hsl(32,14%,87%) !important;
    color: hsl(32,8%,7%) !important;
}
#ai-mod-button2 button.MuiButton-root:hover {
    background: hsl(32,14%,81%) !important;
}
#ai-mod-button2 button.MuiButton-root svg {
    fill: hsl(32,5%,55%) !important;
}

/* §6 ─ 对话气泡 */
.bg-gray-100\/90.relative.inline-block {
    background: hsl(32,14%,99%) !important;
    border: 1px solid hsl(32,14%,82%) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
}
.bg-gray-100\/90.relative.inline-block:not(.chat-answer-container .bg-gray-100\/90) {
    background: hsl(32,14%,95%) !important;
}
.markdown-body {
    color: hsl(32,8%,7%) !important;
    line-height: 1.8 !important;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: hsl(32,8%,7%) !important;
    border-bottom: 1px solid hsl(32,14%,82%) !important;
    padding-bottom: 4px !important;
    margin-bottom: 8px !important;
}
.markdown-body blockquote {
    border-left: 4px solid hsl(40,76%,31%) !important;
    background: hsl(40,26.6%,90%) !important;
    padding: 8px 16px !important;
    font-style: italic !important;
    color: hsl(32,6%,34%) !important;
    margin: 8px 0 !important;
}
.markdown-body table { border-collapse: collapse !important; }
.markdown-body th, .markdown-body td {
    border: 1px solid hsl(32,14%,79%) !important;
    padding: 5px 10px !important;
}
.markdown-body th {
    background: hsl(32,14%,87%) !important;
    color: hsl(32,8%,7%) !important;
}
.markdown-body strong {
    color: hsl(40,60.8%,22%) !important;
    font-weight: 700 !important;
}
.markdown-body em { color: hsl(32,6%,34%) !important; }
.markdown-body a { color: hsl(40,76%,31%) !important; text-decoration: underline; }
.markdown-body hr {
    border: none !important;
    border-top: 1px solid hsl(32,14%,79%) !important;
    margin: 14px 0 !important;
}
.markdown-body ul,
.markdown-body ol {
    padding-left: 1.4em !important;
    color: hsl(32,8%,7%) !important;
}

/* §7 ─ 加载动画 */
.style_dot-flashing__8L91Q.style_text__zGhNq {
    display: none !important;
}
.flex.items-center.justify-center.w-6.h-5 {
    position: relative !important;
    width: 24px !important;
    height: 20px !important;
}
.flex.items-center.justify-center.w-6.h-5::before {
    content: '⚡' !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 14px !important;
    color: hsl(40,76%,31%) !important;
    animation: wdqk-flicker 1.4s ease-in-out infinite !important;
}
@keyframes wdqk-flicker {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

/* §8 ─ 底部输入区 */
.bg-gradient-to-t {
    background: hsl(32,14%,92%) !important;
}
#ai-chat-bottom-input {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
}
#ai-chat-input:focus { border-color: hsl(40,76%,31%) !important; }
#ai-send-button {
    background: hsl(40,76%,31%) !important;
    color: hsl(32,14%,99%) !important;
    border-radius: 8px !important;
    border: none !important;
}
#ai-send-button:hover {
    background: hsl(40,76%,25%) !important;
}

/* §9 ─ 评论区与评分 */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
    background: hsl(32,14%,99%) !important;
    border-top: 1px solid hsl(32,14%,79%) !important;
}
div.text-lg.font-bold { color: hsl(32,8%,7%) !important; }
p.MuiTypography-body1.text-grey-600 { color: hsl(32,6%,34%) !important; }
span.MuiRating-iconEmpty svg { fill: hsl(32,5%,70%) !important; }
span.MuiRating-iconFilled svg { fill: hsl(40,76%,31%) !important; }
span.text-orange-500 { color: hsl(40,76%,31%) !important; }
div.flex.flex-col.border-gray-200 {
    border-color: hsl(32,14%,79%) !important;
}
div.bg-gray-100.text-gray-500 {
    background: hsl(32,14%,87%) !important;
    color: hsl(32,5%,55%) !important;
}
div.cursor-pointer.group.flex.items-center.justify-center:hover {
    background: hsl(32,14%,81%) !important;
}
div[data-state="closed"] svg[data-icon="Send03"] {
    fill: hsl(32,5%,55%) !important;
}
div.style_divider__mW0YX {
    border-color: hsl(32,14%,79%) !important;
    position: relative !important;
}
div.style_divider__mW0YX::after {
    content: '⚡';
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    background: hsl(32,14%,92%);
    padding: 0 6px;
    color: hsl(40,76%,40%);
    font-size: 11px;
}
.MuiStack-root.css-1dmzxoz { gap: 6px !important; }
button.MuiButton-containedPrimary {
    background: hsl(40,76%,31%) !important;
    color: hsl(32,14%,99%) !important;
}
button.MuiButton-outlinedPrimary {
    border-color: hsl(40,76%,31%) !important;
    color: hsl(40,76%,31%) !important;
}
button.MuiButton-outlinedPrimary:hover {
    background: hsl(40,26.6%,90%) !important;
}
div.p-3.overflow-y-auto { background: transparent !important; }
div.group img.rounded-full {
    border: 2px solid hsl(40,26.6%,85%) !important;
}
div.text-sm.text-grey-600 span.font-bold { color: hsl(32,8%,7%) !important; }
span.text-\[10px\] { color: hsl(32,5%,55%) !important; }
div.break-all { color: inherit !important; }
div.text-xs.text-grey-600 { color: hsl(32,6%,34%) !important; }
button.text-gray-400 { color: hsl(32,5%,55%) !important; }
button.text-gray-400:hover { color: hsl(40,76%,31%) !important; }
span.cursor-pointer { color: hsl(32,6%,34%) !important; }
span.cursor-pointer:hover { color: hsl(40,76%,31%) !important; }
div.ml-8.border-l { border-color: hsl(32,14%,79%) !important; }

/* §10 ─ 分页 */
.MuiPaginationItem-root {
    background: transparent !important;
    color: hsl(32,6%,34%) !important;
    border-color: hsl(32,14%,79%) !important;
}
.MuiPaginationItem-root.Mui-selected {
    background: hsl(40,76%,31%) !important;
    color: hsl(32,14%,99%) !important;
}
.MuiPaginationItem-root.Mui-disabled { opacity: 0.5 !important; }
.MuiPaginationItem-icon { fill: hsl(32,5%,55%) !important; }
.MuiStack-root.css-1uwir8f { gap: 8px !important; }
.MuiInputBase-input {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
    border-color: hsl(32,14%,79%) !important;
}

/* §11 ─ MUI 全局组件 */
.MuiButton-root,
.MuiButton-contained,
.MuiButton-outlined {
    border-radius: 6px !important;
    transition: background 0.15s, border-color 0.15s !important;
}
.MuiIconButton-root {
    background: transparent !important;
    color: hsl(32,5%,55%) !important;
}
.MuiIconButton-root:hover {
    background: hsl(32,14%,81%) !important;
}
.MuiDialog-paper {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
}
.MuiDrawer-paper {
    background: hsl(32,14%,99%) !important;
    color: hsl(32,8%,7%) !important;
}
.MuiBackdrop-root {
    background: rgba(10, 7, 3, 0.48) !important;
}
.MuiDivider-root {
    background: hsl(32,14%,79%) !important;
}
.MuiTypography-root { color: inherit !important; }
.MuiOutlinedInput-notchedOutline {
    border-color: hsl(32,14%,79%) !important;
}
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: hsl(40,76%,31%) !important;
}
.MuiTouchRipple-root { color: hsl(40,76%,31%) !important; }
.MuiTypography-root.MuiTypography-body2.css-6c0gf2 {
    color: hsl(32,6%,34%) !important;
}
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary {
    color: hsl(40,76%,31%) !important;
}
.MuiButtonBase-root.MuiButton-root.MuiButton-text.MuiButton-textPrimary:hover {
    background: hsl(40,26.6%,90%) !important;
}

/* §12 ─ 响应式 */
@media (max-width: 480px) {
    .markdown-body pre { font-size: 0.78rem !important; }
    .bg-gray-100\/90.relative.inline-block { padding: 10px 12px !important; }
    details summary { font-size: 0.82rem !important; }
}

/* §13 ─ 降速兜底 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================================ */
/* 作品组件层 — 武动乾坤 AI 输出 grammar 样式                         */
/* grammar 来源：pre_prompt §状态栏 / §正文叙事 / §折叠面板 / §行动选项 */
/* ================================================================ */

/* §A ─ 顶部状态栏（markdown code block）*/
.bg-gray-100\/90.relative.inline-block .markdown-body pre:first-of-type {
    background: hsl(40,20%,97%) !important;
    border-left-color: hsl(40,76%,38%) !important;
    border-left-width: 4px !important;
    font-family: 'Noto Serif SC', 'Noto Sans SC', 'PingFang SC', serif !important;
    font-size: 0.85rem !important;
    line-height: 1.65 !important;
    border-radius: 8px !important;
}

/* §B ─ 叙事正文 <p> */
.bg-gray-100\/90.relative.inline-block .markdown-body p {
    line-height: 1.95 !important;
    text-indent: 2em !important;
    color: hsl(32,10%,8%) !important;
    margin-bottom: 0.75em !important;
}

/* §C ─ 行动选项列表 */
.bg-gray-100\/90.relative.inline-block .markdown-body ol {
    padding-left: 1.2em !important;
    margin: 6px 0 !important;
}
.bg-gray-100\/90.relative.inline-block .markdown-body ol li {
    padding: 5px 0 !important;
    border-bottom: 1px dotted hsl(32,14%,82%) !important;
    color: hsl(40,60.8%,22%) !important;
    font-weight: 500 !important;
}
.bg-gray-100\/90.relative.inline-block .markdown-body ol li:last-child {
    border-bottom: none !important;
}

/* §D ─ 折叠状态面板（5个 details：主角/世界/NPC/新闻/记忆）*/
.bg-gray-100\/90.relative.inline-block details {
    background: hsl(32,10%,99%) !important;
    border-color: hsl(40,40%,76%) !important;
    margin: 4px 0 !important;
}
.bg-gray-100\/90.relative.inline-block details[open] {
    border-color: hsl(40,76%,31%) !important;
    box-shadow: 0 2px 8px rgba(140,100,0,0.10) !important;
}
.bg-gray-100\/90.relative.inline-block details summary {
    background: hsl(40,18%,90%) !important;
    color: hsl(32,8%,7%) !important;
    font-family: 'Noto Serif SC', serif !important;
}
.bg-gray-100\/90.relative.inline-block details summary::before {
    color: hsl(40,76%,31%) !important;
}
.bg-gray-100\/90.relative.inline-block details .markdown-body pre {
    font-size: 0.82rem !important;
    line-height: 1.6 !important;
    background: hsl(32,12%,97%) !important;
    border-left-color: hsl(40,60%,45%) !important;
}
/* 面板内文字不缩进 */
.bg-gray-100\/90.relative.inline-block details .markdown-body p {
    text-indent: 0 !important;
    line-height: 1.7 !important;
    font-size: 0.88rem !important;
    color: hsl(32,8%,12%) !important;
}

/* §E ─ 分隔线 <hr> */
.bg-gray-100\/90.relative.inline-block .markdown-body hr {
    border: none !important;
    border-top: 1px dashed hsl(40,60%,60%) !important;
    margin: 16px 0 !important;
}

/* §F ─ 女性NPC特写（<font color='#DE3163'>）— 可微调行距 */
.bg-gray-100\/90.relative.inline-block .markdown-body font[color='#DE3163'] {
    line-height: 2 !important;
    display: block !important;
    padding: 2px 0 !important;
}
