/* ============================================
   全局背景与容器基调
============================================ */
.MuiContainer-root,
.MuiBox-root {
    background-image: url('你的背景图URL放这里');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================
   顶部时空条 <info>
============================================ */
info {
    display: block;
    margin: 12px 0 16px 0;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(58, 22, 22, 0.92), rgba(90, 45, 30, 0.88), rgba(58, 22, 22, 0.92));
    color: #f5d896;
    font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
    font-size: 14px;
    letter-spacing: 1.2px;
    border-top: 1px solid #c9a961;
    border-bottom: 1px solid #c9a961;
    border-radius: 2px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(201, 169, 97, 0.08);
    text-shadow: 0 0 6px rgba(245, 216, 150, 0.4);
    position: relative;
}

info::before,
info::after {
    content: "❦";
    color: #c9a961;
    margin: 0 12px;
    font-size: 12px;
    opacity: 0.7;
}

/* ============================================
   思维链隐藏
============================================ */
think {
    display: none !important;
}

/* ============================================
   正文块 <story>
============================================ */
story {
    display: block;
    margin: 16px 0;
    padding: 26px 30px;
    background: rgba(245, 235, 214, 0.85);
    color: #3d2817;
    font-family: 'Noto Serif SC', 'Cormorant Garamond', 'Georgia', serif;
    font-size: 15.5px;
    line-height: 2.0;
    letter-spacing: 0.6px;
    border-radius: 4px;
    border: 1px solid rgba(201, 169, 97, 0.55);
    box-shadow: 
        0 4px 20px rgba(58, 22, 22, 0.2),
        inset 0 0 40px rgba(201, 169, 97, 0.08);
    backdrop-filter: blur(4px);
    position: relative;
}

story::before {
    content: "";
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px solid rgba(201, 169, 97, 0.28);
    pointer-events: none;
    border-radius: 2px;
}

story::after {
    content: "❦";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(58, 22, 22, 0.92);
    color: #c9a961;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 50%;
    border: 1px solid #c9a961;
}

story p {
    margin: 0 0 16px 0;
    text-indent: 2em;
    text-align: justify;
    position: relative;
    z-index: 1;
}

story p:last-child {
    margin-bottom: 0;
}

/* 段首首字加大加粗营造小说感 */
story p:first-of-type::first-letter {
    font-size: 1.5em;
    font-weight: 600;
    color: #6b2c2c;
    margin-right: 2px;
    line-height: 1;
}

/* 贤者时间段落(最后一段)样式微调 */
story p:last-of-type:not(:only-of-type) {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(107, 44, 44, 0.35);
    font-style: italic;
    color: #4a3020;
    text-indent: 2em;
}

/* ============================================
   状态栏折叠块 <details>
============================================ */
details {
    margin: 10px 0;
    background: linear-gradient(135deg, rgba(58, 22, 22, 0.88), rgba(45, 18, 18, 0.92));
    border: 1px solid #8b6914;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

details:hover {
    border-color: #c9a961;
    box-shadow: 0 4px 16px rgba(201, 169, 97, 0.25);
}

details[open] {
    background: linear-gradient(135deg, rgba(68, 28, 28, 0.9), rgba(50, 22, 22, 0.94));
    border-color: #c9a961;
}

details summary {
    padding: 12px 18px;
    color: #f5d896;
    font-family: 'Noto Serif SC', serif;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 1.5px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.08), transparent);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::after {
    content: "▾";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #c9a961;
    font-size: 12px;
    transition: transform 0.3s ease;
}

details[open] summary::after {
    transform: translateY(-50%) rotate(180deg);
}

details[open] summary {
    border-bottom: 1px solid rgba(201, 169, 97, 0.4);
    background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.15), transparent);
    text-shadow: 0 0 8px rgba(245, 216, 150, 0.5);
}

details summary:hover {
    background: linear-gradient(90deg, transparent, rgba(201, 169, 97, 0.2), transparent);
    color: #ffe8a8;
}

/* 状态栏内部段落 */
details > p {
    margin: 0;
    padding: 8px 20px;
    color: #ead8b3;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 13px;
    line-height: 1.75;
    border-bottom: 1px dashed rgba(201, 169, 97, 0.15);
    transition: background 0.2s ease;
}

details > p:last-of-type {
    border-bottom: none;
}

details > p:hover {
    background: rgba(201, 169, 97, 0.06);
}

/* 状态栏中括号标签美化【】 */
details > p {
    position: relative;
}

/* 数值型条目高亮 */
details > p:has-text("好感度"),
details > p:has-text("依赖度") {
    color: #f5d896;
}

/* ============================================
   输入框美化(沿用你原有色系,细节强化)
============================================ */
#ai-chat-input {
    background: rgba(245, 235, 214, 0.88) !important;
    color: #3d2817 !important;
    border: none !important;
    font-family: 'Noto Serif SC', serif !important;
    font-size: 14.5px !important;
    letter-spacing: 0.3px !important;
}

#ai-chat-input::placeholder {
    color: #b89968 !important;
    font-style: italic;
}

#ai-chat-input-container,
div:has(> #ai-chat-input) {
    background: rgba(58, 22, 22, 0.35) !important;
    border: 1.5px solid #c9a961 !important;
    border-radius: 10px !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

div:has(> #ai-chat-input):focus-within {
    border-color: #f5d896 !important;
    box-shadow: 0 0 16px rgba(245, 216, 150, 0.4), 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ============================================
   发送按钮
============================================ */
#ai-send-button {
    background: linear-gradient(135deg, #c9a961, #8b6914) !important;
    border-radius: 8px !important;
    border: 1px solid #f5d896 !important;
    transition: all 0.3s ease;
}

#ai-send-button:hover {
    background: linear-gradient(135deg, #f5d896, #c9a961) !important;
    box-shadow: 0 0 14px rgba(245, 216, 150, 0.55);
    transform: scale(1.06);
}

#ai-send-button svg {
    color: #3a1616 !important;
    fill: #3a1616 !important;
}

/* ============================================
   工具栏第一排(文字按钮)
============================================ */
.MuiButton-textPrimary {
    color: #f5d896 !important;
    font-family: 'Noto Serif SC', serif !important;
    letter-spacing: 0.5px !important;
    transition: all 0.25s ease;
}

.MuiButton-textPrimary:hover {
    background: rgba(201, 169, 97, 0.2) !important;
    color: #ffe8a8 !important;
    text-shadow: 0 0 6px rgba(245, 216, 150, 0.5);
}

/* ============================================
   工具栏第二排(轮廓按钮:Mod/记忆增强等)
============================================ */
.MuiButton-outlinedPrimary {
    border-color: #c9a961 !important;
    color: #f5d896 !important;
    background: rgba(58, 22, 22, 0.4) !important;
    font-family: 'Noto Serif SC', serif !important;
    letter-spacing: 0.5px !important;
    transition: all 0.25s ease;
}

.MuiButton-outlinedPrimary:hover {
    background: rgba(201, 169, 97, 0.2) !important;
    border-color: #f5d896 !important;
    color: #ffe8a8 !important;
    box-shadow: 0 0 10px rgba(201, 169, 97, 0.3);
}

/* ============================================
   翻页组件
============================================ */
.MuiPaginationItem-root {
    color: #f5d896 !important;
    border-color: rgba(201, 169, 97, 0.4) !important;
    font-family: 'Cormorant Garamond', serif !important;
    transition: all 0.25s ease;
}

.MuiPaginationItem-root:hover {
    background: rgba(201, 169, 97, 0.15) !important;
    color: #ffe8a8 !important;
}

.MuiPaginationItem-root.Mui-selected {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.35), rgba(139, 105, 20, 0.35)) !important;
    color: #ffe8a8 !important;
    border-color: #c9a961 !important;
    font-weight: 600;
}

/* ============================================
   评论区/Mod区/弹窗统一色调
============================================ */
.MuiDialog-paper,
.MuiPopover-paper,
.MuiMenu-paper {
    background: linear-gradient(135deg, rgba(58, 22, 22, 0.95), rgba(45, 18, 18, 0.97)) !important;
    color: #ead8b3 !important;
    border: 1px solid #c9a961 !important;
    border-radius: 8px !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.MuiDialogTitle-root,
.MuiDialog-paper h2,
.MuiDialog-paper h3 {
    color: #f5d896 !important;
    font-family: 'Noto Serif SC', serif !important;
    letter-spacing: 1px !important;
    border-bottom: 1px solid rgba(201, 169, 97, 0.3) !important;
}

.MuiDialogContent-root,
.MuiDialog-paper p,
.MuiDialog-paper span {
    color: #ead8b3 !important;
}

.MuiTextField-root .MuiOutlinedInput-root {
    background: rgba(245, 235, 214, 0.9) !important;
    color: #3d2817 !important;
}

.MuiTextField-root .MuiOutlinedInput-notchedOutline {
    border-color: #c9a961 !important;
}

.MuiTextField-root label {
    color: #b89968 !important;
}

/* ============================================
   聊天卡片容器背景透明化
   (让背景图透出来)
============================================ */
.MuiCard-root,
.MuiPaper-root {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* ============================================
   AI消息与用户消息气泡区分
============================================ */
[class*="MessageBubble"],
[class*="message-bubble"] {
    background: rgba(58, 22, 22, 0.15) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
}

/* ============================================
   滚动条美化
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(58, 22, 22, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c9a961, #8b6914);
    border-radius: 4px;
    border: 1px solid rgba(58, 22, 22, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f5d896, #c9a961);
}

/* ============================================
   文本选中颜色
============================================ */
::selection {
    background: rgba(201, 169, 97, 0.4);
    color: #3a1616;
}