/* =================================================================
 * ✦ 双界穿梭 · 仙道玉简 UI 引擎 v3.0 (明亮修仙版) - Rili平台适配 ✦
 * ================================================================= */

/* ========== [0] 容器根环境 ========== */
ai {
  /* 主色板 - 明亮修仙主题 */
  --bg-deep: #F5F7F8;        /* 宣纸白 - 底色 */
  --bg-panel: rgba(255, 255, 255, 0.85); /* 白玉 - 卡片底 */
  --bg-panel-lit: rgba(242, 250, 248, 0.95); /* 灵气充盈 - 展开态 */
  
  --tech: #2B5B84;        /* 深海青 - 现代界域 */
  --xian: #117A65;        /* 翠玉绿 - 修仙界域 */
  --warn: #C0392B;        /* 朱砂红 - 警示/火爆 */
  --gold: #B8860B;        /* 鎏金 - 货币/奖励 */
  --purple: #7D3C98;      /* 紫气 - 特殊/锁定 */
  --orange: #D35400;      /* 丹火橙 - 任务/记忆 */
  --pink: #CB4335;        /* 桃花粉 - NPC/羁绊 */
  
  --text: #2C3E50;        /* 浓墨 - 主文本 */
  --text-soft: #566573;   /* 淡墨 - 次文本 */
  --text-mute: #808B96;   /* 枯墨 - 辅助说明 */
  
  --border-faint: rgba(17, 122, 101, 0.15);
  --border-mid: rgba(17, 122, 101, 0.3);
  --border-strong: rgba(17, 122, 101, 0.6);
  
  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(17, 122, 101, 0.15);
  
  display: block;
  font-family: 'STZhongsong', 'SimSun', 'PingFang SC', 'Microsoft YaHei', serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at top right, rgba(17,122,101,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(43,91,132,0.05) 0%, transparent 50%),
    linear-gradient(180deg, #F9FAFC 0%, #EAECEE 100%);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 
    inset 0 0 40px rgba(255,255,255,0.8),
    0 4px 20px rgba(0,0,0,0.06);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  word-wrap: break-word;
}

/* 水墨云纹底纹 */
ai::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(17,122,101,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,122,101,0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

ai > * { position: relative; z-index: 2; }

/* ========== [1] 基础重置 ========== */
ai p, ai div, ai span { margin: 0; padding: 0; }
ai br { line-height: 1.6; }

/* ========== [2] Details 折叠卡片系统 ========== */
ai details {
  background: var(--bg-panel);
  border: 1px solid var(--border-faint);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  backdrop-filter: blur(8px);
}

ai details::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--xian), var(--tech));
  opacity: 0.7;
  transition: opacity 0.3s, width 0.3s;
}

ai details[open] {
  border-color: var(--border-strong);
  background: var(--bg-panel-lit);
  box-shadow: var(--shadow-glow), var(--shadow-soft);
}

ai details[open]::before {
  opacity: 1;
  width: 5px;
  box-shadow: 0 0 12px var(--xian);
}

/* ========== [3] Summary 折叠头 ========== */
ai summary {
  list-style: none;
  padding: 12px 16px 12px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--xian);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, 
    rgba(17,122,101,0.08) 0%, 
    rgba(17,122,101,0.02) 50%, 
    transparent 100%);
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
  letter-spacing: 0.5px;
  position: relative;
}
ai summary::-webkit-details-marker { display: none; }
ai summary::marker { content: ''; }

ai summary::after {
  content: '▼';
  margin-left: auto;
  font-size: 10px;
  color: var(--text-mute);
  transition: all 0.4s;
  transform: rotate(-90deg);
}
ai details[open] > summary::after {
  transform: rotate(0deg);
  color: var(--warn);
}

ai details[open] > summary {
  border-bottom: 1px solid var(--border-mid);
  background: linear-gradient(90deg, 
    rgba(17,122,101,0.15) 0%, 
    rgba(43,91,132,0.05) 50%, 
    transparent 100%);
  color: var(--tech);
}

ai summary:hover {
  background: linear-gradient(90deg, 
    rgba(17,122,101,0.12) 0%, 
    rgba(17,122,101,0.04) 100%);
}

/* 内嵌 Details 风格化 */
ai details details {
  margin: 8px 12px 12px 12px;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}
ai details details::before { background: linear-gradient(180deg, var(--tech), var(--purple)); }
ai details details summary { font-size: 13.5px; color: var(--tech); background: transparent; padding: 9px 12px 9px 16px; }
ai details details[open] > summary { border-bottom: 1px dashed rgba(43,91,132, 0.3); background: linear-gradient(90deg, rgba(43,91,132,0.05), transparent); }

/* ========== [4] 内容区基础布局 ========== */
ai .kono-content,
ai > details > div:not(.kono-opts):not(.kono-grid):not(.kono-block):not(.kono-log):not(.kono-section-title) {
  padding: 14px 16px;
  font-size: 13.5px;
}

ai details > span, ai details > info, ai details > abli {
  display: block;
  padding: 4px 16px;
  margin: 2px 0;
}
ai details > div { padding: 8px 16px; }

/* ========== [5] 网格信息布局 ========== */
ai .kono-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 14px 0;
  padding: 0;
}

ai .kono-grid span, ai details > span {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  background: #FFFFFF;
  padding: 7px 10px;
  border-radius: 5px;
  border-left: 2px solid var(--text-mute);
  border: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
  transition: all 0.25s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

ai .kono-grid span:hover, ai details > span:hover {
  background: rgba(17, 122, 101, 0.05);
  border-left: 3px solid var(--xian);
  transform: translateX(2px);
}

/* ========== [6] 自定义语义徽章 (玉牌风格) ========== */
ai name, ai info, ai abli, ai SL, ai sl {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  margin-bottom: 2px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  line-height: 1.5;
  vertical-align: middle;
  background: #FFF;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

ai name { color: var(--purple); border: 1px solid rgba(125, 60, 152, 0.3); border-left: 3px solid var(--purple); }
ai info { color: var(--xian); border: 1px solid rgba(17, 122, 101, 0.3); border-left: 3px solid var(--xian); }
ai SL, ai sl { color: var(--gold); border: 1px solid rgba(184, 134, 11, 0.3); border-left: 3px solid var(--gold); background: #FFFAF0; }
ai abli { color: var(--warn); border: 1px solid rgba(192, 57, 43, 0.3); border-left: 3px solid var(--warn); background: #FDEDEC; }

/* ========== [7] 块状内容 (卷轴引言) ========== */
ai .kono-block {
  background: linear-gradient(90deg, rgba(17,122,101,0.08), rgba(17,122,101,0.02));
  padding: 10px 14px;
  border-radius: 5px;
  margin: 8px 0;
  border-left: 3px solid var(--xian);
  color: var(--text);
  transition: all 0.3s;
}

/* ========== [8] 章节标题 ========== */
ai .kono-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--xian);
  margin: 18px 0 10px 0;
  padding: 6px 0 6px 0;
  border-bottom: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  letter-spacing: 1px;
  position: relative;
}
ai .kono-section-title::before {
  content: '◈';
  font-size: 14px;
  margin-right: 8px;
  color: var(--gold);
}
ai .kono-section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ========== [9] 日志/记录区 (竹简风格) ========== */
ai .kono-log {
  background: #F4E8D3; /* 旧纸黄 */
  background-image: repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0,0,0,0.03) 20px, rgba(0,0,0,0.03) 21px);
  padding: 14px 16px;
  border-radius: 3px;
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: 14px;
  color: #3E2723;
  border: 1px solid #D7CCC8;
  border-left: 4px solid #8D6E63;
  margin: 10px 0;
  line-height: 1.85;
  position: relative;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}
ai .kono-log::before {
  content: '卷宗';
  position: absolute;
  top: -10px;
  right: 12px;
  background: #8D6E63;
  padding: 2px 8px;
  font-size: 11px;
  color: #FFF;
  border-radius: 2px;
}

/* ========== [10] 表格美化 (系统商店核心 - 强制暗黑科技风隔离) ========== */
ai table {
  /* 独立暗黑变量域 */
  --tab-bg: #07090F;
  --tab-tech: #00E5FF;
  --tab-gold: #FFD700;
  --tab-warn: #FF3366;
  --tab-text: #E0E6ED;
  --tab-border: rgba(0, 229, 255, 0.3);
  
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0;
  font-size: 12.5px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--tab-bg);
  color: var(--tab-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 
    0 0 0 2px #000,
    0 0 15px rgba(0,229,255,0.4);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tab-border);
}

ai thead, ai tbody { display: table; width: 100%; }

ai th {
  background: linear-gradient(180deg, rgba(0,229,255,0.2), rgba(0,229,255,0.05));
  color: var(--tab-tech);
  font-weight: 700;
  text-align: left;
  padding: 10px;
  font-size: 12px;
  letter-spacing: 1px;
  border-bottom: 2px solid rgba(0,229,255,0.6);
  text-shadow: 0 0 8px rgba(0,229,255,0.5);
  text-transform: uppercase;
  white-space: nowrap;
}

ai td {
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  vertical-align: middle;
  transition: all 0.25s;
  color: var(--tab-text);
}

ai tr:last-child td { border-bottom: none; }
ai tr:nth-child(even) td { background: rgba(0, 0, 0, 0.6); }

ai tr:hover td {
  background: rgba(0, 229, 255, 0.12) !important;
  color: #fff;
  box-shadow: inset 0 0 15px rgba(0,229,255,0.2);
}

/* 火爆推荐 */
ai td:first-child { font-weight: 700; color: var(--tab-gold); }

/* 价格样式特化（仅限表格内或含特定标签） */
ai s {
  color: #6B7A90;
  text-decoration: line-through;
  text-decoration-color: var(--tab-warn);
  text-decoration-thickness: 1.5px;
  margin-right: 4px;
}
ai td strong, ai table strong {
  color: var(--tab-gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  font-weight: 800;
}

/* ========== [11] 行动选项按钮 (白玉飞剑风) ========== */
ai .kono-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.4), rgba(240,245,245,0.8));
  border-top: 1px solid var(--border-mid);
  border-radius: 0 0 8px 8px;
  margin-top: 12px;
}

ai .kono-btn {
  position: relative;
  padding: 12px 16px 12px 24px;
  background: #FFFFFF;
  border: 1px solid rgba(17, 122, 101, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

ai .kono-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 4px;
  background: var(--xian);
  transition: all 0.3s;
}

ai .kono-btn::after {
  content: '剑指 ⋙';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--xian);
  opacity: 0;
  transition: all 0.3s;
}

ai .kono-btn:hover {
  background: linear-gradient(90deg, #FFFFFF, #F0F9F6);
  border-color: var(--xian);
  color: var(--xian);
  padding-left: 28px;
  box-shadow: 0 4px 12px rgba(17, 122, 101, 0.15);
  transform: translateX(4px);
}

ai .kono-btn:hover::before { width: 6px; }
ai .kono-btn:hover::after { opacity: 1; right: 12px; }

ai .kono-btn-skip { border-color: rgba(125, 60, 152, 0.2); }
ai .kono-btn-skip::before { background: var(--purple); }
ai .kono-btn-skip::after { content: '遁走 ⋙'; color: var(--purple); }
ai .kono-btn-skip:hover {
  background: linear-gradient(90deg, #FFFFFF, #F9F0FA);
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 4px 12px rgba(125, 60, 152, 0.15);
}

/* ========== [12] Markdown 兼容渲染 ========== */
ai ul, ai ol { padding-left: 22px; margin: 8px 0; }
ai ul li, ai ol li { margin-bottom: 5px; position: relative; line-height: 1.7; }
ai ul li::marker { color: var(--xian); }
ai ol li::marker { color: var(--gold); font-weight: bold; }

ai h1, ai h2, ai h3, ai h4 {
  color: var(--xian);
  margin: 14px 0 8px 0;
  font-weight: 700;
}
ai h1 { font-size: 18px; border-bottom: 2px solid var(--border-mid); padding-bottom: 4px; }
ai h2 { font-size: 16px; color: var(--tech); }
ai h3 { font-size: 14.5px; color: var(--gold); }
ai h4 { font-size: 13.5px; color: var(--purple); }

ai blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--pink);
  background: rgba(203, 67, 53, 0.05);
  color: var(--text-soft);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

ai code {
  background: rgba(17, 122, 101, 0.08);
  color: var(--xian);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.9em;
  border: 1px solid rgba(17, 122, 101, 0.15);
}

ai em { color: var(--pink); font-style: italic; }

ai a {
  color: var(--tech);
  text-decoration: none;
  border-bottom: 1px dashed var(--tech);
  transition: all 0.2s;
}
ai a:hover { color: var(--warn); border-bottom-color: var(--warn); }

ai hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
  margin: 16px 0;
}

/* ========== [13] 记忆储存特化 (丹火卷轴) ========== */
ai details.sub-sys {
  background: #FFF8F0;
  border-color: rgba(211, 84, 0, 0.2);
}
ai details.sub-sys::before { background: linear-gradient(180deg, var(--orange), var(--gold)); }
ai details.sub-sys[open] {
  border-color: rgba(211, 84, 0, 0.4);
  box-shadow: 0 4px 15px rgba(211, 84, 0, 0.08);
}
ai details.sub-sys > summary { color: var(--orange); background: linear-gradient(90deg, rgba(211,84,0,0.08), transparent); }
ai details.sub-sys[open] > summary {
  background: linear-gradient(90deg, rgba(211,84,0,0.12), transparent);
  border-bottom-color: rgba(211,84,0,0.2);
}
ai details.sub-sys > div {
  padding: 10px 16px;
  background: rgba(255,255,255,0.6);
  border-left: 2px solid rgba(211,84,0,0.3);
  margin: 6px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* ========== [14] 移动端适配 ========== */
@media (max-width: 480px) {
  ai { padding: 10px; font-size: 13.5px; }
  ai summary { font-size: 14px; padding: 10px 12px 10px 16px; }
  ai .kono-grid { grid-template-columns: 1fr; gap: 6px; }
  ai .kono-content, ai > details > div { padding: 10px 12px; }
  ai table { font-size: 11.5px; margin: 12px 0; }
  ai th, ai td { padding: 8px 6px; }
  ai .kono-btn { padding: 10px 14px 10px 20px; font-size: 13px; }
  ai name, ai info, ai abli, ai SL, ai sl { font-size: 10.5px; padding: 2px 6px; margin-right: 5px; }
}

/* ========== [15] 入场动画 ========== */
ai details { animation: fadeInUp 0.5s ease-out backwards; }
ai details:nth-child(1) { animation-delay: 0.05s; }
ai details:nth-child(2) { animation-delay: 0.10s; }
ai details:nth-child(3) { animation-delay: 0.15s; }
ai details:nth-child(4) { animation-delay: 0.20s; }
ai details:nth-child(5) { animation-delay: 0.25s; }
ai details:nth-child(6) { animation-delay: 0.30s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 行动选项延迟入场 */
ai .kono-opts .kono-btn { animation: slideInRight 0.4s ease-out backwards; }
ai .kono-opts .kono-btn:nth-child(1) { animation-delay: 0.3s; }
ai .kono-opts .kono-btn:nth-child(2) { animation-delay: 0.35s; }
ai .kono-opts .kono-btn:nth-child(3) { animation-delay: 0.4s; }
ai .kono-opts .kono-btn:nth-child(4) { animation-delay: 0.45s; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== [16] 滚动条美化 ========== */
ai ::-webkit-scrollbar { width: 6px; height: 6px; }
ai ::-webkit-scrollbar-track { background: rgba(0,0,0,0.05); border-radius: 3px; }
ai ::-webkit-scrollbar-thumb { background: rgba(17, 122, 101, 0.4); border-radius: 3px; }
ai ::-webkit-scrollbar-thumb:hover { background: var(--xian); }

/* ========== [17] 选中文字效果 ========== */
ai ::selection { background: rgba(17, 122, 101, 0.2); color: var(--text); }

/* ========== [18] 文本内容增强 ========== */
ai details > info ~ *, ai details > span + br { display: inline; }
ai details > div:first-of-type { margin-top: 4px; }
ai b, ai strong { color: var(--warn); font-weight: 700; }

/* ============================================================
   魔国联邦 (Tempest Federation) 思维链样式
   ============================================================ */
.cot-container details {
    --rimuru-blue-light : #aeeeff;
    --rimuru-blue-main  : #4fc3f7;
    --rimuru-blue-deep  : #0288d1;
    --shuna-pink        : #f48fb1;
    --shion-purple      : #7e57c2;
    --benimaru-red      : #ef5350;
    --tempest-bg        : #0d1b2a;
    --tempest-card      : #162447;
    position        : relative;
    overflow        : hidden;
    margin          : 18px 0;
    border-radius   : 12px;
    background-color : rgba(22, 36, 71, 0.85);
    backdrop-filter  : blur(5px);
    border      : 1px solid rgba(79, 195, 247, 0.4);
    border-left : 4px solid var(--rimuru-blue-main);
    font-family : 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color       : #e3f2fd;
    line-height : 1.6;
    box-shadow :
        0 4px 15px rgba(0, 0, 0, 0.5),
        0 0  10px rgba(79, 195, 247, 0.15),
        inset 0 0 20px rgba(126, 87, 194, 0.1);
    transition : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cot-container details:hover {
    border-color : var(--rimuru-blue-light);
    box-shadow   :
        0 8px 25px rgba(0, 0, 0, 0.6),
        0 0  15px var(--rimuru-blue-main),
        inset 0 0 10px var(--shuna-pink);
}

.cot-container details::before {
    content    : '';
    position   : absolute;
    top        : 0;
    left       : 0;
    width      : 100%;
    height     : 2px;
    background : linear-gradient(90deg, transparent, var(--shuna-pink), var(--rimuru-blue-main), var(--shion-purple), transparent);
    opacity    : 0.8;
}

.cot-container summary {
    background    : linear-gradient(135deg, rgba(13, 27, 42, 0.95) 0%, rgba(27, 38, 59, 0.95) 100%);
    display         : flex;
    align-items     : center;
    padding         : 16px 24px;
    position        : relative;
    color           : var(--rimuru-blue-light);
    font-weight     : 600;
    font-size       : 1.1em;
    letter-spacing  : 0.05em;
    cursor          : pointer;
    list-style      : none;
    user-select     : none;
    border-bottom   : 1px solid rgba(79, 195, 247, 0.2);
    transition      : all 0.3s ease;
}

.cot-container summary:hover {
    background  : linear-gradient(135deg, rgba(20, 35, 60, 0.95) 0%, rgba(40, 50, 80, 0.95) 100%);
    color       : #fff;
    text-shadow : 0 0 8px var(--rimuru-blue-main);
}

.cot-container summary::-webkit-details-marker { display : none; }

.cot-container summary::before {
    content     : '✦';
    color       : var(--shuna-pink);
    margin-right: 12px;
    font-size   : 1.3em;
    line-height : 1;
    display     : inline-block;
    transition  : transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.cot-container details[open] summary::before {
    transform   : rotate(90deg) scale(1.2);
    color       : var(--benimaru-red);
    text-shadow : 0 0 10px rgba(239, 83, 80, 0.6);
}

.cot-container summary::after {
    content    : '';
    position   : absolute;
    bottom     : 0;
    left       : 0;
    width      : 0%;
    height     : 1px;
    background : linear-gradient(90deg, var(--shuna-pink), var(--rimuru-blue-main));
    box-shadow : 0 0 8px var(--rimuru-blue-main);
    transition : width 0.5s ease;
}

.cot-container details[open] summary::after { width : 100%; }

.cot-container details > div, .cot-container .cot-content {
    padding    : 24px 28px;
    background : linear-gradient(to bottom, rgba(79, 195, 247, 0.05), transparent);
}

.cot-container hr {
    border     : 0;
    height     : 1px;
    background : linear-gradient(90deg, transparent, var(--shion-purple), var(--rimuru-blue-main), var(--benimaru-red), transparent);
    margin     : 25px 0;
    opacity    : 0.6;
}

.cot-container p { margin-bottom : 1.2em; text-align : justify; color : #cfd8dc; }
.cot-container strong { color : var(--rimuru-blue-light); font-weight : bold; }

.cot-container p:first-of-type::first-letter {
    font-family  : serif;
    font-size    : 2.2em;
    color        : #fff;
    float        : left;
    line-height  : 0.8;
    margin-right : 8px;
    margin-top   : 4px;
    padding      : 4px 8px;
    background   : linear-gradient(135deg, var(--shion-purple), #4527a0);
    border        : 1px solid rgba(255, 255, 255, 0.2);
    border-radius : 6px;
    box-shadow    : 0 2px 5px rgba(0, 0, 0, 0.3);
}

.cot-container ul, .cot-container ol { padding-left : 10px; margin : 15px 0; }
.cot-container li { position : relative; padding-left : 20px; margin-bottom : 8px; list-style : none; }
.cot-container ul li::before {
    content     : '➤';
    position    : absolute;
    left        : 0;
    top         : 3px;
    font-size   : 0.9em;
    color       : var(--benimaru-red);
    text-shadow : 0 0 5px rgba(239, 83, 80, 0.4);
}

.cot-container pre, .cot-container code {
    font-family      : 'Consolas', monospace;
    font-size        : 0.9em;
    color            : var(--shuna-pink);
    background-color : rgba(10, 15, 30, 0.6);
    border           : 1px solid rgba(126, 87, 194, 0.3);
    border-radius    : 4px;
    padding          : 2px 6px;
}

.cot-container pre {
    padding     : 16px;
    margin      : 20px 0;
    overflow-x  : auto;
    border-left : 3px solid var(--shion-purple);
    background  : repeating-linear-gradient(45deg, rgba(13, 27, 42, 0.7), rgba(13, 27, 42, 0.7) 10px, rgba(20, 35, 60, 0.7) 10px, rgba(20, 35, 60, 0.7) 20px);
}

.cot-container a { color : var(--rimuru-blue-main); text-decoration: none; border-bottom : 1px dashed var(--rimuru-blue-main); transition : all 0.2s; }
.cot-container a:hover { color : var(--shuna-pink); border-bottom-color: var(--shuna-pink); text-shadow : 0 0 5px var(--shuna-pink); }

@media (max-width: 768px) {
    .cot-container details { margin : 15px 0; border-radius : 8px; }
    .cot-container summary { padding : 14px 18px; }
}

/* 象牙白纸张质感背景美化 */
.kono-narrative {
    background-color: #fcf9f2; 
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.06'/%3E%3C/svg%3E");
    color: #2c2724; 
    padding: 16px;
    margin: 8px 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 0 30px rgba(210, 195, 175, 0.15); 
    border: 1px solid rgba(210, 195, 175, 0.4);
    line-height: 1.7;
    font-size: 15px;
    text-align: justify;
}

.kono-narrative p { margin: 0 0 0.8em 0; text-indent: 2em; }
.kono-narrative p:last-child { margin-bottom: 0; }

/* 统一聊天框基础样式：宣纸水墨质感适配Rili平台 */
/* 用户输入框 */
.group.is-user .is-user\:dark {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%) !important;
    border: 1px solid #d3d3d3 !important;
    border-radius: 12px !important;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    color: #1a1a1a !important; /* 强制深色文字 */
}

/* AI回复框 */
.group.is-assistant .is-user\:dark {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%) !important;
    border: 1px solid #d3d3d3 !important;
    border-radius: 12px !important;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08) !important;
    position: relative !important;
    isolation: isolate !important;
    overflow: hidden !important;
    color: #1a1a1a !important; /* 强制深色文字 */
}

/* 聊天框背景动效：流动的云雾水墨感 */
.group.is-user .is-user\:dark::before,
.group.is-assistant .is-user\:dark::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important; 
    left: -150% !important; 
    width: 200% !important; 
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent) !important;
    z-index: 0 !important;
    animation: inkMistFlow 8s linear infinite !important;
    pointer-events: none !important;
}

@keyframes inkMistFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

@media(prefers-reduced-motion:reduce) {
    .group.is-user .is-user\:dark::before,
    .group.is-assistant .is-user\:dark::before {
        animation-duration: 20s !important;
    }
}

/* 聊天框主要文本内容：高对比度深色，楷体修仙风 */
.rili-markdown-renderer {
    color: #1a1a1a !important;
    font-family: "KaiTi", "STKaiti", "SimSun", serif !important;
    font-weight: bold !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

/* AI回复框底部的token信息等 */
.flex.items-center.gap-2.text-xs.font-mono.text-muted-foreground {
    color: #4a4a4a !important;
    font-family: "KaiTi", "STKaiti", "SimSun", serif !important;
    font-weight: bold !important;
}

/* 隐藏默认的点状加载动画 (Rili平台的加载动画是三个span) */
.flex.gap-2.w-full.h-full.items-center.justify-center span {
    display: none !important;
}

/* 调整加载容器的尺寸与布局，以便容纳太极图和文字 */
.flex.gap-2.w-full.h-full.items-center.justify-center {
    position: relative !important;
    width: 120px !important; 
    height: 30px !important;
    justify-content: flex-start !important;
    padding-left: 35px !important;
}

/* ::before：太极八卦图 SVG SMIL 旋转动画 */
.flex.gap-2.w-full.h-full.items-center.justify-center::before {
    content: url('data:image/svg+xml;utf8,<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"><g><animateTransform attributeName="transform" type="rotate" from="0 60 60" to="360 60 60" dur="4s" repeatCount="indefinite"/><circle cx="60" cy="60" r="58" fill="none" stroke="%231a1a1a" stroke-width="2" stroke-dasharray="15 6 5 6"/><circle cx="60" cy="60" r="50" fill="none" stroke="%231a1a1a" stroke-width="1.5" stroke-dasharray="30 10"/><circle cx="60" cy="60" r="40" fill="none" stroke="%231a1a1a" stroke-width="2"/><path d="M60 20 a 20 20 0 0 1 0 40 a 20 20 0 0 0 0 40 a 40 40 0 0 1 0 -80" fill="%231a1a1a"/><circle cx="60" cy="40" r="6" fill="%23fff"/><circle cx="60" cy="80" r="6" fill="%231a1a1a"/></g></svg>') !important;
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    transform: translateY(-50%) scale(0.25) !important;
    width: 120px !important;
    height: 120px !important;
    transform-origin: left center !important;
}

/* ::after：附带的加载文字及呼吸闪烁特效 */
.flex.gap-2.w-full.h-full.items-center.justify-center::after {
    content: "推演天机中..." !important;
    position: absolute !important;
    left: 35px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #1a1a1a !important;
    font-family: "KaiTi", "STKaiti", "SimSun", serif !important;
    font-weight: bold !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    animation: textBreathe 2s ease-in-out infinite !important;
}

@keyframes textBreathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   ★ tooltip 技能/装备悬浮提示 .tp ★
   ============================================ */
ai .tp {
  display: inline-block;
  padding: 3px 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0070f3;
  background: rgba(0, 112, 243, 0.06);
  border: 1px solid rgba(0, 112, 243, 0.2);
  border-radius: 4px;
  cursor: default;
  position: relative;
  transition: all 0.25s;
  text-decoration: none;
  z-index: 2;
}

ai .tp:hover {
  background: rgba(0, 112, 243, 0.12);
  border-color: rgba(0, 112, 243, 0.35);
  color: #0051b3;
  box-shadow: 0 4px 12px rgba(0, 112, 243, 0.15);
  transform: translateY(-1px);
  z-index: 200;
}

ai .tp > span {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  background: linear-gradient(135deg, #ffffff 0%, #f4f9ff 100%);
  border: 1px solid rgba(0, 112, 243, 0.2);
  border-radius: var(--radius, 6px);
  box-shadow: 0 8px 24px rgba(0, 30, 80, 0.08), 0 2px 8px rgba(0, 30, 80, 0.04);
  z-index: 9999;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  pointer-events: none;
  line-height: 1.55;
  white-space: pre-wrap;
  text-align: left;
}

ai .tp > span::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(0, 112, 243, 0.2);
  filter: drop-shadow(0 2px 2px rgba(0, 30, 80, 0.05));
}

ai .tp > span::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0070f3, transparent);
  opacity: 0.5;
  border-radius: var(--radius, 6px) var(--radius, 6px) 0 0;
}

ai .tp:hover > span {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
  pointer-events: auto;
}

ai .tp > span b { color: #0070f3; display: block; margin-bottom: 3px; font-size: 12.5px; }

ai .ny .tp > span, ai .nc .tp > span, ai .il .tp > span { bottom: auto; top: calc(100% + 10px); transform: translateX(-50%) translateY(-6px); }
ai .ny .tp:hover > span, ai .nc .tp:hover > span, ai .il .tp:hover > span { transform: translateX(-50%) translateY(0); }
ai .ny .tp > span::before, ai .nc .tp > span::before, ai .il .tp > span::before { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: rgba(0, 112, 243, 0.2); }

ai g.sf .tp:first-child > span { left: 0; transform: translateX(0) translateY(6px); }
ai g.sf .tp:first-child:hover > span { transform: translateX(0) translateY(0); }
ai g.sf .tp:first-child > span::before { left: 16px; transform: none; }

ai .tp.rs { color: #e11d48; background: rgba(225, 29, 72, 0.06); border-color: rgba(225, 29, 72, 0.2); }
ai .tp.rs:hover { background: rgba(225, 29, 72, 0.12); border-color: rgba(225, 29, 72, 0.35); box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15); color: #be123c; }
ai .tp.rs > span { border-color: rgba(225, 29, 72, 0.2); box-shadow: 0 8px 24px rgba(225, 29, 72, 0.08), 0 2px 8px rgba(225, 29, 72, 0.04); background: linear-gradient(135deg, #ffffff 0%, #fff4f6 100%); }
ai .tp.rs > span::before { border-top-color: rgba(225, 29, 72, 0.2); }
ai .tp.rs > span::after { background: linear-gradient(90deg, transparent, #e11d48, transparent); }
ai .tp.rs > span b { color: #e11d48; }

ai .tp.eq { color: #d97706; background: rgba(217, 119, 6, 0.06); border-color: rgba(217, 119, 6, 0.2); }
ai .tp.eq:hover { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.35); box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15); color: #b45309; }

ai .tp.pk { color: #db2777; background: rgba(219, 39, 119, 0.06); border-color: rgba(219, 39, 119, 0.2); font-size: 12px; }
ai .tp.pk:hover { background: rgba(219, 39, 119, 0.12); border-color: rgba(219, 39, 119, 0.35); box-shadow: 0 4px 12px rgba(219, 39, 119, 0.15); color: #be185d; }
ai .tp.pk > span { border-color: rgba(219, 39, 119, 0.2); box-shadow: 0 8px 24px rgba(219, 39, 119, 0.08), 0 2px 8px rgba(219, 39, 119, 0.04); background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%); }
ai .tp.pk > span::before { border-top-color: transparent; border-bottom-color: rgba(219, 39, 119, 0.2); }
ai .tp.pk > span::after { background: linear-gradient(90deg, transparent, #db2777, transparent); }
ai .tp.pk > span b { color: #db2777; }

/* =========================================
   【国风修仙主题】全局字体与顶部栏美化 (Rili适配)
   ========================================= */
/* 顶部栏主容器：水墨渐变背景，琉璃金底边 */
header.sticky.w-full.top-0 {
    background: linear-gradient(135deg, #1a221f 0%, #2c3e35 100%) !important;
    border-bottom: 2px solid #cda85f !important;
    box-shadow: 0 4px 15px rgba(44, 62, 53, 0.4) !important;
    backdrop-filter: blur(4px) !important;
}

/* 顶部各类图标：染为琉璃金 */
header.sticky.w-full.top-0 svg {
    color: #cda85f !important;
    transition: transform 0.3s ease, filter 0.3s ease !important;
}

/* 图标悬浮：灵气波动效果 */
header.sticky.w-full.top-0 button:hover svg {
    transform: scale(1.1) rotate(5deg) !important;
    filter: drop-shadow(0 0 3px #cda85f) !important;
}

/* =========================================
   【国风修仙主题】底部输入栏美化 (Rili适配)
   ========================================= */
/* 底部输入框容器背景 */
.fixed.bottom-0.w-full {
    background: linear-gradient(to top, #e6efe9 0%, rgba(248, 250, 249, 0.9) 100%) !important;
}

/* 主输入框：宣纸质感 */
textarea {
    background: #fdfdfc !important;
    border: 1px solid #8cae9d !important;
    border-radius: 12px !important;
    color: #1a221f !important;
    font-family: "STKaiti", "KaiTi", "楷体", serif !important;
    font-size: 16px !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
}

/* 输入框聚焦：琉璃金边 */
textarea:focus {
    border-color: #cda85f !important;
    box-shadow: 0 0 10px rgba(205, 168, 95, 0.3), inset 0 2px 4px rgba(0,0,0,0.05) !important;
    outline: none !important;
}

/* 占位符与文字选中：青玉色 */
textarea::placeholder {
    color: #8cae9d !important;
    font-style: italic !important;
}
textarea::selection {
    background: #8cae9d !important;
    color: #ffffff !important;
}