/* ═══ B平台加载动画适配（自动注入）═══ */
.flex.items-center.justify-center.size-6 { opacity: 1 !important; }
.flex.items-center.justify-center.size-6 > .flex.gap-2 { display: none !important; }

/* ═══ B平台表格修正（自动注入）═══ */
.rili-markdown-renderer table { display:table!important; table-layout:auto!important; width:100%!important; border-collapse:collapse!important; }
.rili-markdown-renderer table caption { display:table-caption!important; caption-side:top!important; text-align:center!important; padding:8px!important; }
.rili-markdown-renderer thead { display:table-header-group!important; }
.rili-markdown-renderer tbody { display:table-row-group!important; }
.rili-markdown-renderer tr { display:table-row!important; }
.rili-markdown-renderer th, .rili-markdown-renderer td { display:table-cell!important; }

/* ═══ B平台按钮组保护（自动注入 — 防止按钮消失）═══
   原理：B平台消息操作按钮结构为：
   .flex.items-center.gap-1.ml-auto (hover显隐包装)
     └── .bg-muted.rounded.flex.p-0.5 (按钮组容器)
           └── button.rounded-full.size-7 (单个按钮)
   以下规则使用高specificity + !important确保按钮
   不被任何转换后/透传的CSS规则意外隐藏
   ═══════════════════════════════════════════════ */
/* 按钮组容器保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5,
.is-user .bg-muted.rounded.flex.p-0\.5,
.is-assistant .bg-muted.rounded.flex.p-0\.5 {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-height: none !important;
  pointer-events: auto !important;
  clip: auto !important;
  clip-path: none !important;
}
/* 单个按钮保护 */
.w-full.h-full.flex.group .bg-muted.rounded.flex.p-0\.5 > button,
.is-user .bg-muted.rounded.flex.p-0\.5 > button,
.is-assistant .bg-muted.rounded.flex.p-0\.5 > button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  clip: auto !important;
  clip-path: none !important;
}
/* hover显隐包装层保护 — 仅保留B平台原生的opacity过渡 */
.flex.items-center.gap-1.ml-auto.md\:opacity-0.group-hover\:opacity-100 {
  visibility: visible !important;
  display: flex !important;
  pointer-events: auto !important;
  overflow: visible !important;
}
/* 操作行保护 */
.flex.w-full.items-center.justify-between.gap-2.px-2 {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* 荒岛主题 - 根容器 */
.island-ui-root {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e2e;
}

/* 折叠面板基础美化 */
.island-ui-root details {
    background: rgba(233, 245, 216, 0.4);
    border: 1px solid #8a9a5b;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 5px 10px 10px 10px;
}
.island-ui-root summary {
    font-weight: bold;
    color: #344e41;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 2px dashed #a3b18a;
    margin-bottom: 8px;
    list-style: none;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* 卡片容器 */
.ui-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 6px;
    padding: 10px;
    box-shadow: inset 0 0 8px rgba(163, 177, 138, 0.2);
    border-left: 3px solid #588157;
}
.npc-card {
    background: rgba(254, 250, 224, 0.9); /* NPC专属暖沙色 */
    border-left: 3px solid #d4a373;
}

/* 文本行样式 (保留了你要求的一行一条) */
.ui-text {
    font-size: 0.95em;
    line-height: 1.5;
    padding: 3px 0;
    border-bottom: 1px solid rgba(163, 177, 138, 0.2);
}
.ui-text:last-child {
    border-bottom: none;
}
.ui-text b {
    color: #3a5a40;
    margin-right: 4px;
}

/* 小标题分割线 */
.ui-section-title {
    font-size: 0.9em;
    font-weight: bold;
    color: #fefae0;
    background: #588157;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    margin: 10px 0 5px 0;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* 记忆区表格美化 */
.memory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    margin-bottom: 10px;
    background: #fff;
    font-size: 0.85em;
}
.memory-table th, .memory-table td {
    border: 1px solid #a3b18a;
    padding: 6px;
    text-align: left;
}
.memory-table th {
    background: #a3b18a;
    color: white;
}

/* 行动推荐按钮 */
.ui-action-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ui-action-btn {
    background: linear-gradient(to right, #a3b18a, #8a9a5b);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    border-left: 4px solid #3a5a40;
    transition: filter 0.2s;
}
.ui-action-btn:hover {
    filter: brightness(1.1);
}

/* 正文区美化 */
.island-ui-root text {
    display: block;
    padding: 15px;
    font-size: 1.05em;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fff;
    border-left: 4px solid #a3b18a;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
/* 生理观测记录专属UI */
.body-obs-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 12px 0;
}
.body-obs-item {
    display: flex;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(163, 177, 138, 0.5);
    border-radius: 6px;
    overflow: hidden; /* 确保圆角能包住内部标签 */
    box-shadow: 1px 1px 3px rgba(0,0,0,0.05);
}
.body-label {
    background: #7a8a50; /* 深度荒岛绿 */
    color: #fefae0;
    padding: 6px 8px;
    font-weight: bold;
    font-size: 0.85em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 55px; /* 保证标签宽度一致，对齐更好看 */
    border-right: 1px solid rgba(163, 177, 138, 0.5);
}
.body-desc {
    padding: 6px 10px;
    font-size: 0.9em;
    line-height: 1.4;
    color: #2c3e2e;
    flex: 1; /* 让描述部分占满剩余空间 */
}
.island-ui-root summary {
    /* 原有代码保留 */
    font-weight: bold;
    color: #344e41;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 2px dashed #a3b18a;
    margin-bottom: 8px;
    list-style: none; /* 依然隐藏默认的 */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    
    /* 新增：为自定义箭头留出位置 */
    position: relative;
    padding-left: 20px; 
}

/* 新增：自己画一个绿色小三角 */
.island-ui-root summary::before {
    content: "▶"; 
    color: #588157;
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 0.8em;
    transition: transform 0.2s ease;
}

/* 当折叠面板打开时，箭头旋转90度 */
.island-ui-root details[open] summary::before {
    transform: rotate(90deg);
}
/* =========================================
   荒岛求生主题 - 网站全局UI美化 (黄绿丛林风)
   ========================================= */

/* 1. 顶部栏 (导航栏) 美化 */
.header-container, .top-nav-bar, .van-nav-bar {
    background: linear-gradient(to bottom, #3a5a40, #588157) !important;
    border-bottom: 2px solid #8a9a5b !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
}
.header-title, .van-nav-bar__title, .van-nav-bar__text, .van-icon {
    color: #fefae0 !important; /* 顶部文字和图标变成沙滩白 */
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
}

/* 2. 聊天框 (对话气泡) 美化 */
/* 整个聊天背景铺一层极淡的沙色 */
.chat-container, .message-list {
    background-color: #fdfcf0 !important; 
}
/* AI回复的气泡 (左侧) - 丛林绿叶色 */
.message-bubble-ai, .chat-message.ai .bubble {
    background: rgba(233, 245, 216, 0.85) !important;
    border: 1px solid #a3b18a !important;
    color: #2c3e2e !important;
    border-radius: 2px 12px 12px 12px !important;
    box-shadow: 2px 2px 5px rgba(163, 177, 138, 0.2) !important;
}
/* 用户发送的气泡 (右侧) - 干燥原木/沙土色 */
.message-bubble-user, .chat-message.user .bubble {
    background: #fefae0 !important;
    border: 1px solid #d4a373 !important;
    color: #344e41 !important;
    border-radius: 12px 2px 12px 12px !important;
    box-shadow: -2px 2px 5px rgba(212, 163, 115, 0.2) !important;
}

/* 3. 底部输入栏美化 */
.footer-input-area, .chat-input-container {
    background: #e9f5d8 !important; /* 浅绿底色 */
    border-top: 2px solid #a3b18a !important;
    padding: 10px !important;
}
/* 输入框本体 */
textarea.chat-input, .input-box {
    background: #ffffff !important;
    border: 2px dashed #8a9a5b !important; /* 虚线边框，像缝合的皮革 */
    border-radius: 8px !important;
    color: #2c3e2e !important;
}
textarea.chat-input:focus {
    border: 2px solid #588157 !important;
    background: #fefae0 !important;
}

/* 4. 底部功能按钮 (Mod、流式、快捷回复等) */
.action-buttons-row .btn, .mod-btn, .stream-btn, .quick-reply-btn {
    background: linear-gradient(135deg, #a3b18a, #8a9a5b) !important;
    color: #ffffff !important;
    border: 1px solid #588157 !important;
    border-radius: 6px !important;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease;
}
.action-buttons-row .btn:hover, .mod-btn:hover {
    background: linear-gradient(135deg, #588157, #3a5a40) !important;
    transform: translateY(-1px);
}
/* 激活/开启状态的按钮 (比如流式开启) */
.btn.active, .stream-btn.active {
    background: #d4a373 !important; /* 开启状态变成醒目的木头色 */
    border-color: #bc6c25 !important;
}

/* 5. 页码 (Pagination) 美化 */
.pagination-container, .van-pagination {
    margin: 15px 0 !important;
}
.van-pagination__item, .page-item {
    background: #fefae0 !important;
    color: #588157 !important;
    border: 1px solid #a3b18a !important;
    border-radius: 4px !important;
    margin: 0 3px !important;
}
/* 当前页码 */
.van-pagination__item--active, .page-item.active {
    background: #588157 !important;
    color: #ffffff !important;
    border-color: #3a5a40 !important;
    font-weight: bold !important;
}

/* 6. 评论区 (Comments) 美化 */
.comments-section {
    background: #fefae0 !important;
    border-top: 3px solid #8a9a5b !important;
}
.comment-item {
    border-bottom: 1px dashed #a3b18a !important;
    padding: 10px 0 !important;
}
.comment-avatar {
    border: 2px solid #8a9a5b !important;
    border-radius: 50% !important;
}
.comment-author {
    color: #3a5a40 !important;
    font-weight: bold !important;
}
.comment-content {
    color: #2c3e2e !important;
}
.comment-time {
    color: #7a8a50 !important;
}
/* =========================================
   荒岛主题 (Island Theme) - 聊天框美化
========================================= */

/* 1. 隐藏默认的顶部颜色装饰条 */
[class*="bg-[#F1CBCB]"], 
[class*="bg-[#c9e1e9]"] {
    display: none !important;
}

/* 2. 统一聊天框基础样式 (输入与输出共有) */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted {
    /* 采用主题中的浅色暖沙与浅绿渐变，确保背景明亮 */
    background: linear-gradient(135deg, #fefae0 0%, #e9f5d8 100%) !important;
    border: 1px solid #a3b18a !important;
    border-left: 4px solid #588157 !important; /* 呼应主题的左侧粗边框 */
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(163, 177, 138, 0.2), inset 0 0 8px rgba(255, 255, 255, 0.5) !important;
    padding: 12px !important;
    transition: all 0.3s ease !important;
}

/* 悬浮时微微加深阴影 */
.is-user > .border.border-muted,
.is-assistant > .border.border-muted:hover {
    box-shadow: 0 6px 16px rgba(163, 177, 138, 0.3), inset 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* 3. 单独的输入聊天框 (用户发言) - 区分颜色 */
.is-user > .border.border-muted {
    background: linear-gradient(135deg, #ffffff 0%, #fefae0 100%) !important;
    border-left: 4px solid #d4a373 !important; /* 使用主题中的NPC暖沙色作为区分 */
    border-color: #d4a373 !important;
}

/* 4. 聊天框内主要文本内容 (绝对可读性保证) */
.rili-markdown-renderer {
    /* 使用主题定义的深绿色，在浅色背景上提供极高对比度 */
    color: #2c3e2e !important; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.05em !important;
    line-height: 1.6 !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 强调文本使用更深的森林绿 */
.rili-markdown-renderer strong, 
.rili-markdown-renderer b {
    color: #1a3a2a !important;
    font-weight: bold !important;
}

/* 5. 聊天框底部附加元素 (按钮、模型名称、Token等) */
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7,
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground,
/* [Token消耗hover逻辑转换未启用]
.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7,
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground,
.text-orange-500 {
    color: #588157 !important; /* 统一使用中绿色，融入主题 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    opacity: 0.85 !important;
    transition: opacity 0.2s !important;
}
*/

.bg-muted.rounded.flex.p-0\.5 > button.rounded-full.size-7{
    opacity: 1 !important;
    color: #3a5a40 !important; /* 悬浮时变深绿 */
    background-color: rgba(163, 177, 138, 0.15) !important;
}

/* 6. 输出聊天框的加载元素 (防屏蔽SMIL SVG动画，自然水滴/树叶色) */
/* 隐藏默认加载点 */
.style-module__AtdJSq__dot-flashing.style-module__AtdJSq__text {
    display: none !important;
}

/* 设置加载容器 */
.flex.items-center.justify-center.size-6 {
    position: relative !important;
    min-width: 40px !important;
}

/* 注入自定义SVG加载动画 (绿色系跳动圆点) */
.flex.items-center.justify-center.size-6::before {
    content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="20" viewBox="0 0 40 20"><circle cx="10" cy="10" r="4" fill="%238a9a5b"><animate attributeName="cy" values="10;5;10" dur="0.8s" repeatCount="indefinite" begin="0s"/></circle><circle cx="20" cy="10" r="4" fill="%23588157"><animate attributeName="cy" values="10;5;10" dur="0.8s" repeatCount="indefinite" begin="0.2s"/></circle><circle cx="30" cy="10" r="4" fill="%233a5a40"><animate attributeName="cy" values="10;5;10" dur="0.8s" repeatCount="indefinite" begin="0.4s"/></circle></svg>') !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: block !important;
}

/* 移动端微调 */
@media(max-width: 480px) {
    .is-user > .border.border-muted,
.is-assistant > .border.border-muted {
        padding: 10px !important;
        border-left-width: 3px !important;
    }
}
/* 当前叙事风格 - 状态行强调 */
.ui-style-status {
    background: rgba(163, 177, 138, 0.18);
    border-left: 3px solid #8a9a5b;
    border-radius: 4px;
    padding: 6px 10px;
    margin-top: 8px;
    font-weight: 500;
}
.ui-style-status b {
    color: #3a5a40;
}
/* 荒野求生题材 - 对话专属CSS */

/* 玩家 (You) - 泥土与迷彩的硬核求生者风格 */
you {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px 0;
    color: #e0d8c8; /* 风化羊皮纸般的文字颜色 */
    background-color: #4a5d23; /* 经典的军绿/迷彩底色 */
    border-left: 4px solid #2e3b16; /* 深邃的丛林阴影边框 */
    border-radius: 2px 8px 8px 2px;
    font-family: "Courier New", Courier, monospace; /* 带有战术终端感的字体 */
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); /* 粗糙的阴影 */
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.7); /* 让文字在暗色背景上更清晰 */
}

/* 伊娃 (Heroine) - 篝火旁的温暖与希望 */
heroine {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px 0;
    color: #fff3e0; /* 篝火映照下的暖白色 */
    background-color: #8b4513; /* 饱经风霜的红松木/皮革色 */
    border-right: 4px solid #d2691e; /* 像燃烧的余烬一样的边框 */
    border-radius: 8px 2px 2px 8px;
    font-weight: bold;
    font-style: italic; /* 微微倾斜，显得更柔和生动 */
    box-shadow: -2px 2px 5px rgba(0, 0, 0, 0.5);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 给对话加点悬停互动感（可选，PC端效果好） */
you:hover {
    background-color: #556b2f;
    transition: background-color 0.3s ease;
}

heroine:hover {
    background-color: #a0522d;
    transition: background-color 0.3s ease;
}
/* =========================================
   荒岛求生主题 - AI风月原生UI强行覆盖版
   ========================================= */

/* 1. 全局背景铺底 (避开body，改用最外层容器) */
#app, .app-container {
    background-color: #fdfcf0 !important; /* 沙滩色 */
}

/* 2. 顶部导航栏 */
[class*="nav-bar"], [class*="header"] {
    background: linear-gradient(to bottom, #3a5a40, #588157) !important;
    border-bottom: 2px solid #8a9a5b !important;
}
[class*="nav-bar"] *, [class*="header"] * {
    color: #fefae0 !important; 
}

/* 3. 聊天气泡区域 */
/* AI气泡 (通常在左侧) */
[class*="message"][class*="ai"] > div, 
[class*="chat-item"]:not([class*="user"]) [class*="bubble"] {
    background: rgba(233, 245, 216, 0.9) !important;
    border: 1px solid #a3b18a !important;
    color: #2c3e2e !important;
    border-radius: 2px 12px 12px 12px !important;
}
/* 用户气泡 (通常在右侧) */
[class*="message"][class*="user"] > div, 
[class*="chat-item"][class*="user"] [class*="bubble"] {
    background: #fefae0 !important;
    border: 1px solid #d4a373 !important;
    color: #344e41 !important;
    border-radius: 12px 2px 12px 12px !important;
}

/* 4. 底部输入栏 & 文本框 */
[class*="footer"], [class*="bottom-bar"], [class*="input-area"] {
    background: #e9f5d8 !important;
    border-top: 2px solid #a3b18a !important;
}
textarea, input[type="text"] {
    background: #ffffff !important;
    border: 2px dashed #8a9a5b !important;
    color: #2c3e2e !important;
    border-radius: 8px !important;
}
textarea:focus, input[type="text"]:focus {
    border: 2px solid #588157 !important;
    background: #fefae0 !important;
}
/* 尝试抓取激活状态的按钮 */
button[class*="active"], [class*="btn"][class*="active"] {
    background: #d4a373 !important;
    border-color: #bc6c25 !important;
}
/* 4. 底部功能按钮 (Mod、流式、快捷回复等) */
.action-buttons-row .btn, .mod-btn, .stream-btn, .quick-reply-btn {
    background: linear-gradient(135deg, #a3b18a, #8a9a5b) !important;
    color: #ffffff !important;
    border: 1px solid #588157 !important;
    border-radius: 6px !important;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.15) !important;
    transition: all 0.2s ease;
}
.action-buttons-row .btn:hover, .mod-btn:hover {
    background: linear-gradient(135deg, #588157, #3a5a40) !important;
    transform: translateY(-1px);
}
/* 激活/开启状态的按钮 (比如流式开启) */
.btn.active, .stream-btn.active {
    background: #d4a373 !important; /* 开启状态变成醒目的木头色 */
    border-color: #bc6c25 !important;
}
/* 5. 底部功能按钮 (Mod、流式、快捷回复等) */
button, [role="button"], [class*="btn"] {
    background: linear-gradient(135deg, #a3b18a, #8a9a5b) !important;
    color: #ffffff !important;
    border: 1px solid #588157 !important;
    border-radius: 6px !important;
}
button:hover, [role="button"]:hover {
    filter: brightness(1.1) !important;
}
/* 尝试抓取激活状态的按钮 */
button[class*="active"], [class*="btn"][class*="active"] {
    background: #d4a373 !important;
    border-color: #bc6c25 !important;
}
/* 6. 页码器 */
[class*="pagination"] li, [class*="page-item"] {
    background: #fefae0 !important;
    color: #588157 !important;
    border: 1px solid #a3b18a !important;
}
[class*="pagination"] li[class*="active"], [class*="page-item"][class*="active"] {
    background: #588157 !important;
    color: #ffffff !important;
}

/* 7. 评论区 */
[class*="comment"] {
    background: #fefae0 !important;
    border-color: #a3b18a !important;
}