/* --- 1. AI思考加载动画 (保持不变，功能完美) --- */
.style_dot-flashing__8L91Q {
  display: none !important;
}
div:has(> .style_dot-flashing__8L91Q.style_text__zGhNq) {
  width: 100% !important;
  height: auto !important;
  min-height: 20px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
div:has(> .style_dot-flashing__8L91Q.style_text__zGhNq)::before {
  content: '🌸' !important;
  font-size: 16px !important;
  margin-right: 8px !important;
  display: inline-block !important;
  animation: flower-spin 2s linear infinite !important;
}
div:has(> .style_dot-flashing__8L91Q.style_text__zGhNq)::after {
  content: '世界线渲染中……建议记忆4Pro游玩' !important;
  font-family: "Microsoft YaHei", "Arial", sans-serif !important;
  font-style: italic !important;
  font-size: 14px !important;
  color: rgba(0, 0, 0, 0.6) !important;
}
@keyframes flower-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* --- 2. 基础与段落样式 (遵嘱，P标签保持不变) --- */
* {
    box-sizing: border-box;
}
p:not(.MuiTypography-root):not(.MuiTypography-body2) {
    font-family: "Microsoft YaHei", "Arial", sans-serif;
    font-size: 16px;
    line-height: 24px;
    margin-top: 20px;
    margin-bottom: 16px;
    margin-left: 17px;
    margin-right: 13px;
    letter-spacing: 0.5px;
}
/* --- 3. [升级] H1 标题样式 --- */
h1 {
    font-family: "Microsoft YaHei", "Arial", sans-serif;
    font-size: 1.2em; /* 使用em单位更灵活 */
    font-weight: bold;
    background-color: #f0f0f0; /* 柔和的背景灰 */
    color: #333;
    padding: 10px 15px; /* 增加内边距 */
    margin-top: 2em; /* 与上方内容保持距离 */
    margin-bottom: 1em;
    border-bottom: 2px solid #e0e0e0; /* 用底部线条分割 */
    border-left: 5px solid #666; /* 左侧添加强调色条 */
    border-radius: 4px; /* 轻微的圆角 */
}

/* --- 4. [升级] Details & Summary 信息面板 --- */
details {
    background: #f9f9f9; /* 更轻盈的背景色 */
    border: 1px solid #eee; /* 细边框代替粗边框 */
    border-left: 4px solid #aaa; /* 左侧强调线使用柔和的灰色 */
    border-radius: 6px; /* 更明显的圆角 */
    padding: 0.5em 1em; /* 调整内边距 */
    margin: 1em 0;
    transition: all 0.2s ease-in-out; /* 为悬浮和展开添加过渡动画 */
}
details:hover {
    border-left-color: #333; /* 鼠标悬浮时，左侧强调线变深 */
}
summary {
    color: #333; /* 更柔和的字体颜色 */
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5em 0;
    outline: none; /* 去掉点击时的虚线框 */
    position: relative; /* 为小三角图标定位 */
    transition: margin 0.2s ease-in-out; /* 为展开时的边距变化添加动画 */
}
/* 使用::before伪元素创建小三角图标 */
summary::before {
    content: '▸';
    position: absolute;
    left: -0.8em;
    top: 0.6em;
    transition: transform 0.2s ease-in-out; /* 为旋转添加动画 */
}
details[open] > summary {
    margin-bottom: 1em;
    border-bottom: 1px solid #eee; /* 展开后的分割线更细 */
}
/* 当details展开时，旋转小三角图标 */
details[open] > summary::before {
    transform: rotate(90deg);
}
/* --- 4.5. [整序] 卷轴样式 · 情报整理 --- */
details table {
    width: 100%;
    border-collapse: collapse; /* 合并边框，使表格更整洁 */
    margin-top: 1em;
}

/* 针对表头和单元格的通用样式 */
details th,
details td {
    border: 1px solid #e0e0e0; /* 使用与主题匹配的浅灰色边框 */
    padding: 10px 12px;
    text-align: left;
    color: #333; /* 确保字体颜色与你的主题一致 */
    background-color: transparent !important; /* 核心封印术：强制背景透明，破除所有默认背景色！*/
}

/* 美化表头，使其更易区分 */
details th {
    background-color: #f0f0f0; /* 给表头一个略深的背景，与H1标题背景色呼应 */
    font-weight: bold;
}

/* 为数据行添加一个悬停反馈，提升交互体验 */
details tbody tr:hover {
    background-color: #f5f5f5; /* 鼠标悬停时，行背景变为柔和的灰色高亮 */
}


/* --- 6. 其他保留样式 --- */
font {
    font-family: "Microsoft YaHei", "Arial", sans-serif;
    font-weight: bold;
}
memory {
    display: none;
}
p[Foreword] {
    font-family: "Microsoft YaHei", "Arial", sans-serif;
    font-style: italic;
    text-decoration: underline;
    color: #333;
}
/* --- 新增：美化Details内部的PRE内容 --- */

pre {
    font-family: "Microsoft YaHei", "Arial", sans-serif;
    font-size: 1em; /* 继承父级字体大小 */
    line-height: 1.7; /* 设置合适的行高 */
    color: #363636; /* 设置统一的字体颜色 */
    background-color: transparent; /* 确保背景是透明的 */
    border: none; /* 去掉可能的边框 */
    padding: 0; /* 去掉内边距 */
    margin: 0; /* 去掉外边距 */
    white-space: pre-wrap !important; /* 保留自动换行，并提升优先级以防被意外覆盖 */
}

/* --- 6. 命运选择面板 (Destiny Choice Panel) · 亮色主题 [最终修正 v3] --- */
/*
 * 使用 !important 来强制覆盖平台的默认 <pre> 样式
 */

.destiny-choice-panel {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
               "Helvetica Neue", Arial, sans-serif;
  color: #363636; /* 默认黑色文字 */
  line-height: 1.7;
  /* 盒子模型 */
  border: 1px solid #dbdbdb; /* 浅灰色边框 */
  border-radius: 8px;
  padding: 1em;
  margin: 1em 0; 
  background-color: #ffffff; /* 明确的白色背景 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
}
/* 面板标题 (h3) */
.destiny-choice-panel h3 {
  margin-top: 0;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eeeeee;
  color: #363636; /* 确保标题也是黑色 */
}
/* 选项文本容器 (pre) */
.destiny-choice-panel pre {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  color: #363636 !important; 
  white-space: pre-wrap !important;
}

/*
  Catai 评论区美化 CSS - [V5 最终·纯白主题]
  
  - 核心：美化 .flex.items-start 元素。
  - 主题：纯白背景 (#ffffff) + 深色文字。
  - 间距：减小评论之间的分隔线 (divider) 边距。
*/

/* 1. 精准选择卡片元素，设置为 "纯白卡片" 样式 */
.group.ml-0 > .flex.items-start.gap-2 {
    /* 字体 (保持不变) */
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif !important;
    /* 纯白卡片样式 */
    background-color: #ffffff !important; /* 纯白色背景 */
    border-radius: 12px !important;
    padding: 15px 20px !important; /* 卡片内部边距 (保留) */
    width: 100% !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important; /* 柔和阴影 */
    border: 1px solid #e0e0e0 !important; /* 浅灰色边框 */
    /* 移除玻璃态，因为纯白背景不需要 */
    /* backdrop-filter: none !important; */
    /* 平滑过渡效果 */
    transition: all 0.3s ease-in-out !important;
}
/* 2. 悬停效果 (亮色版) */
.group.ml-0 > .flex.items-start.gap-2:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important; /* 阴影加深 */
    background-color: #fcfcfc !important; /* 悬停时一点点灰色 */
    border-color: #d0d0d0 !important;
}
/* 3. 美化内部的评论内容区 (.break-all) */
.group.ml-0 .break-all {
    white-space: pre-wrap !important;
    line-height: 1.6 !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    color: #333333 !important; /* 关键：确保内容文字是深色 */
}
/* 4. [关键] 确保卡片内部的文本颜色是深色，以便在白底上阅读 */
.group.ml-0 > .flex.items-start.gap-2 .text-grey-600 {
    color: #555 !important; /* 强制用户名/时间戳为深灰色 */
}
.group.ml-0 > .flex.items-start.gap-2 .text-gray-500 {
    color: #777 !important; /* 强制 "游玩 xx 轮" 等文字为中灰色 */
}
.group.ml-0 > .flex.items-start.gap-2 .text-gray-400 {
    color: #999 !important; /* 强制点赞按钮等为浅灰色 */
}
.group.ml-0 > .flex.items-start.gap-2 .font-bold {
    color: #111111 !important; /* 强制用户名(你)为近黑色 */
}
/* 5. [解决间距] 减小评论之间的分隔线 (divider) 的外边距 */
div.style_divider__mW0YX.style_horizontal__UvaHt {
    margin-top: 10px !important; /* 覆盖 !my-4 (原16px) */
    margin-bottom: 10px !important; /* 覆盖 !my-4 (原16px) */    
    /* 顺便美化一下分隔线本身，配 合亮色主题 */
    border-top: 1px solid #eeeeee !important; 
    background: none !important;
}
/* === [重铸·型月] 神秘学通讯终端 UI === */

/* --- 1. 主通讯界面 · 魔术工房 --- */
.chat {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px 24px;
    /* 背景色调转为更深邃的黑石/暗紫色调 */
    background: linear-gradient(145deg, #1a1a1a 0%, #2a1a2a 50%, #1c1c24 100%);
    /* 边框改为金色与赤色的渐变，如同契约之证 */
    border: 2px solid transparent;
    border-image: linear-gradient(to bottom right, #ffc107, #c0392b) 1;
    border-radius: 4px;
    margin: 24px 0;
    position: relative;
    font-family: 'Georgia', 'Times New Roman', serif; /* 更换为更具古典感的衬线字体 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* 背景花纹替换为神秘符文与魔法阵 */
.chat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cdefs%3E%3Cpattern id='a' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='50' cy='50' r='45' fill='none' stroke='%23ffc107' stroke-width='0.3'/%3E%3Cpath d='M50 20 L25 70 L75 70 Z' fill='none' stroke='%23c0392b' stroke-width='0.2'/%3E%3C/pattern%3E%3Cpattern id='b' width='50' height='50' patternUnits='userSpaceOnUse'%3E%3Cpath d='M0 0 L50 50 M50 0 L0 50' stroke='%23ffffff' stroke-width='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23b)' opacity='0.05'/%3E%3Crect width='100%25' height='100%25' fill='url(%23a)' opacity='0.08'/%3E%3C/svg%3E");
    background-position: 0 0;
    animation: bg-scroll-fate 60s linear infinite;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
@keyframes bg-scroll-fate {
    from { background-position: 0 0; }
    to { background-position: 300px 300px; }
}

.chat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* 增加一层渐变光晕，聚焦中心 */
    background: radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 0;
}

.chat > * {
    position: relative;
    z-index: 1;
}

/* --- 2. 对话气泡 · 结界展开 --- */
.bubble {
    max-width: 75%;
    padding: 16px 20px;
    position: relative;
    line-height: 1.7;
    word-wrap: break-word;
    /* 增加半透明背景和毛玻璃效果，如同魔术结界 */
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible; /* 允许伪元素溢出 */
}
.bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* NPC气泡 · 英灵/魔术师 */
.bubble.npc {
    align-self: flex-start;
    border: 1px solid rgba(255, 193, 7, 0.5); /* 金色边框 */
    color: #e3f2fd;
}
/* NPC气泡的装饰性边角 */
.bubble.npc::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 20px;
    height: 20px;
    border-top: 2px solid #ffc107;
    border-left: 2px solid #ffc107;
    border-top-left-radius: 10px;
}

/* 魔力粒子光点 */
.bubble.npc::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #ffc107 20%, transparent 80%);
    border-radius: 50%;
    box-shadow: 0 0 12px #ffc107;
    animation: pulse-mana 2.5s ease-in-out infinite;
    z-index: 2;
}

/* 用户气泡 · 御主/影之从者 */
.bubble.user {
    align-self: flex-end;
    background: rgba(40, 30, 35, 0.75); /* 偏红/紫的暗色 */
    border: 1px solid rgba(192, 57, 43, 0.5); /* 赤色边框 */
    color: #f0f0f5;
}
/* 用户气泡的装饰性边角 */
.bubble.user::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #c0392b;
    border-right: 2px solid #c0392b;
    border-bottom-right-radius: 10px;
}

/* 气泡内通用元素样式 */
.bubble .name {
    display: block;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 8px;
    opacity: 0.9;
    font-family: sans-serif; /* 名字用更易读的非衬线体 */
}
.bubble.npc .name { color: #ffc107; } /* 金色名字 */
.bubble.user .name { color: #ccc; }
.bubble .msg { margin: 0; padding: 0; font-size: 1em; }

/* 动画帧：魔力粒子 */
@keyframes pulse-mana {
    0%, 100% {
        opacity: 0.8;
        transform: scale(0.9);
        box-shadow: 0 0 10px #ffc107;
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        box-shadow: 0 0 18px #ffc107;
    }
}

/* --- 3. 文档阅读 · 圣堂教会档案 --- */
.doc {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid #a9a9a9;
    border-radius: 3px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    font-family: 'Georgia', serif;
}
.doc .title {
    color: #ffc107;
    border-bottom: 1px solid #ffc107;
    padding-bottom: 12px;
    margin: 0 0 16px 0;
    font-size: 1.5em;
    text-align: center;
    letter-spacing: 2px;
}
.doc .content {
    color: #e3f2fd;
    line-height: 1.8;
    font-size: 1.05em;
}
.doc .content p { margin: 0 0 1em 0; }

/* --- 4. 专有名词释义 · 根源之涡 --- */
.tip {
    position: relative;
    color: #ffc107;
    cursor: help;
    border-bottom: 1px dashed rgba(255, 193, 7, 0.5);
}
.tip .text {
    visibility: hidden;
    width: 280px;
    background-color: #1a1a1a;
    color: #fff;
    text-align: left;
    border-radius: 3px;
    padding: 12px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -140px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    border: 1px solid #ffc107;
    box-shadow: 0 5px 15px rgba(0,0,0,0.7);
    font-size: 0.9em;
    line-height: 1.5;
}
.tip .text::after { /* Tooltip arrow */
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #ffc107 transparent transparent transparent;
}
.tip:hover .text {
    visibility: visible;
    opacity: 1;
}

.progress-bar {
    /* 基础布局与尺寸 */
    display: inline-block;      /* 保证可以和文字在同一行显示 */
    width: 150px;               /* 进度条总宽度 */
    height: 18px;               /* 进度条高度 */
    vertical-align: middle;     /* 确保和旁边的文字垂直对齐 */
    
    /* 外观样式 */
    border: 1px solid #b0b0b0;  /* 边框，增加质感 */
    border-radius: 9px;         /* 圆角 */
    background-color: #e0e0e0;  /* 进度条的底色（轨道颜色）*/
    overflow: hidden;           /* 隐藏内部渐变的溢出部分 */

    /* 文字样式 */
    font-family: monospace;     /* 使用等宽字体，让数字更好看 */
    font-size: 12px;
    font-weight: bold;
    color: #333;                /* 文字颜色 */
    line-height: 16px;          /* 调整行高，让文字垂直居中 */
    text-align: center;         /* 文字水平居中 */
    text-shadow: 0 0 2px #fff;  /* 给文字加一点白色描边，使其在深色背景上也清晰 */

    /* 核心：动态进度效果 */
    /* 
       --p 是一个自定义CSS变量，我们可以在HTML中直接修改它。
       这个线性渐变会从左到右画一个颜色：
       1. 从0%到var(--p)的位置，都是#4CAF50（绿色）。
       2. 从var(--p)的位置开始，立刻变成#e0e0e0（灰色）。
    */
    background: linear-gradient(
        to right, 
        #4CAF50 var(--p, 0%), 
        #e0e0e0 var(--p, 0%)
    );
}