/* === 基础全局设置（仅限 ai 作用域）=== */
ai {
  display: block;
  max-width: 800px;
  margin: 20px auto;
  padding: 24px;
  background: #fcf6e8; /* 仿古黄纸底 */
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  font-family: "LXGW WenKai", "Georgia", "Songti SC", serif;
  line-height: 1.8;
  color: #3c2415;
}

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

/* === 顶部状态栏（时间/地点/天气）=== */
ai hd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 24px;
  padding: 12px 16px 16px 16px;
  margin-bottom: 24px;
  background: #fffbf5;
  border-radius: 12px;
  border: 1px solid #eaddcf;
  font-size: 15px;
  color: #6b5a4a;
  letter-spacing: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
ai hd f {
  color: #c62a2a; /* 朱砂红 */
  font-weight: bold;
  margin-right: 4px;
}

/* === 正文段落（奏折行文）：整体合并 === */
ai article {
  background: #fffbf5;
  padding: 16px 20px;
  border-radius: 12px;
  border-left: 4px solid #c62a2a; /* 朱批竖线移至外层 */
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 24px;
}
ai article p {
  text-indent: 2em;
  margin: 0;
  padding: 0;
  line-height: 2;
  text-align: justify;
  /* 去掉内部多余间距和装饰，使所有段落连成一体 */
}

/* === 折叠面板（卡片风格） === */
ai details {
  background: #fffbf5;
  border: 1px solid #eaddcf;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}
ai details:hover {
  border-color: #c9a84c; /* 鎏金悬停 */
}
ai details summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  color: #4a3425;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
ai details summary::-webkit-details-marker {
  display: none;
}
ai details summary::after {
  content: "▼";
  font-size: 12px;
  color: #c9a84c;
  transition: transform 0.2s;
  margin-left: auto;
}
ai details[open] summary::after {
  transform: rotate(180deg);
}
ai details[open] {
  border-color: #d4c5af;
}
ai details[open] summary {
  border-bottom: 1px solid #f0e4d0;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

/* === 嵌套折叠面板（记忆区内部配置等）=== */
ai details details {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 10px 14px;
  background: #faf5ed;
  border-color: #eaddcf;
}
ai details details summary {
  font-size: 14px;
  font-weight: 600;
  color: #5a4a3a;
}
ai details details summary::after {
  font-size: 10px;
  color: #c62a2a;
}

/* === 内部数据行（<d>）=== */
ai d {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 4px 0;
  font-size: 14px;
  gap: 4px 8px;
}
ai d f {
  font-weight: bold;
  color: #8b5e3c;
  min-width: 60px;
}
ai d f::after {
  content: "：";
  color: #c9a84c;
}
ai d v {
  font-weight: bold;
  color: #3c2415;
}
ai d q {
  font-style: italic;
  color: #7a6a5a;
  font-size: 0.9em;
  padding-left: 8px;
  border-left: 1px solid #ddd0c0;
}
ai d m {
  display: block;
  margin: 4px 0;
  padding-left: 16px;
  color: #5a4a3a;
  border-left: 2px solid #c9a84c;
}

/* === 特殊属性行（状态/资源/行动/危险）=== */
ai d[t="stat"] {
  background: #fcf6f0; /* 淡淡朱砂红底 */
  padding: 6px 12px;
  border-radius: 8px;
  margin: 2px 0;
}
ai d[t="res"] {
  background: #f8f5ef;
  padding: 6px 12px;
  border-radius: 8px;
}
ai d[t="sub"] {
  font-weight: bold;
  color: #c62a2a;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 15px;
  border-bottom: 1px dashed #d4c5af;
  width: 100%;
  padding-bottom: 4px;
}
ai d[t="act"] {
  padding: 6px 14px;
  margin: 4px 0;
  background: #f5efe6;
  border-radius: 8px;
  border-left: 3px solid #c9a84c;
  cursor: pointer;
}
ai d[t="danger"] {
  background: #fce8e8; /* 危险红底 */
  border: 1px solid #e6b8b8;
  border-radius: 8px;
  padding: 6px 12px;
}

/* === 数据数值（根据等级上色）=== */
ai v[lv="h"] { color: #c62a2a !important; } /* 高危/高值 - 朱砂红 */
ai v[lv="m"] { color: #c9a84c !important; } /* 中危/中值 - 鎏金 */
ai v[lv="l"] { color: #6b9e6b !important; } /* 低危/低值 - 墨绿 */

/* === 响应式微调 === */
@media (max-width: 600px) {
  ai { padding: 12px; margin: 10px; }
  ai hd { font-size: 13px; gap: 8px; }
  ai details { padding: 12px; }
}
/* ========== 女帝凤仪 · 华贵暗黑风 ========== */

/* --- 顶部栏：暗血龙鳞 + 金边毛玻璃 --- */
.sticky.w-full.top-0.flex.items-center {
  background: rgba(18, 6, 6, 0.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 2px 24px rgba(200, 40, 40, 0.15), inset 0 -1px 0 rgba(212, 175, 55, 0.25) !important;
  /* 龙鳞暗纹（重复菱形） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 L22 12 L12 22 L2 12 Z' fill='none' stroke='%23d4af37' stroke-width='0.4' opacity='0.08'/%3E%3Cpath d='M12 6 L18 12 L12 18 L6 12 Z' fill='none' stroke='%23d4af37' stroke-width='0.3' opacity='0.05'/%3E%3C/svg%3E") !important;
  background-size: 24px 24px !important;
  background-repeat: repeat !important;
}

/* 模型选择器 */
#ai-model-selector .group.flex.items-center {
  background: rgba(30, 14, 14, 0.7) !important;
  border-radius: 24px !important;
  padding: 2px 14px !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  box-shadow: 0 0 10px rgba(200, 40, 40, 0.1) !important;
  transition: all 0.3s ease !important;
}
#ai-model-selector .group.flex.items-center:hover {
  background: rgba(45, 20, 20, 0.9) !important;
  border-color: rgba(212, 175, 55, 0.6) !important;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.2) !important;
}
#ai-model-selector .truncate.text-\[13px\] {
  color: #f0d9b5 !important;
  font-weight: 600 !important;
}
#ai-model-selector .shrink-0.flex.items-center svg {
  color: #d4af37 !important;
  transition: transform 0.2s ease !important;
}
#ai-model-selector .group:hover .shrink-0.flex.items-center svg {
  transform: rotate(180deg) !important;
  color: #f0c040 !important;
  filter: drop-shadow(0 0 4px #d4af37) !important;
}

/* 历史图标：古金 */
.sticky.w-full.top-0 svg.lucide-clock-8 {
  color: #d4af37 !important;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.6)) !important;
}
/* 未读角标：朱砂红 */
.sticky.w-full.top-0 span.MuiBadge-dot.md\:hidden {
  background-color: #b71c1c !important;
  box-shadow: 0 0 8px #b71c1c, 0 0 0 2px rgba(18, 6, 6, 0.9) !important;
}
/* 音乐按钮 */
.sticky.w-full.top-0 button.MuiIconButton-root:has(svg.lucide-music-2) {
  color: #c49b4a !important;
  border-radius: 50% !important;
  transition: background 0.2s, box-shadow 0.2s !important;
}
.sticky.w-full.top-0 button.MuiIconButton-root:has(svg.lucide-music-2):hover {
  background: rgba(212, 175, 55, 0.12) !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3) !important;
}
/* 设置按钮 */
#header-setting-button {
  color: #c49b4a !important;
  transition: all 0.2s ease !important;
}
#header-setting-button:hover {
  background: rgba(212, 175, 55, 0.1) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35) !important;
}
.sticky.w-full.top-0 svg:has(use[href="#icon-icon-set"]) {
  color: #c49b4a !important;
  filter: drop-shadow(0 0 3px #d4af37) !important;
}

/* --- 开场白选择器：皇冠印记 + 暗金边框 --- */
div.flex.items-center.h-9.bg-white.rounded-md.cursor-pointer.group[class*="border-gray"],
div.h-9.rounded-md.cursor-pointer.group:has(svg[data-icon="SlidersH"]) {
  background: rgba(24, 10, 10, 0.8) !important;
  border: 1px solid rgba(212, 175, 55, 0.25) !important;
  border-radius: 20px !important;
  padding: 0 10px !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: inset 0 0 8px rgba(180, 40, 40, 0.08) !important;
  position: relative !important;
  overflow: visible !important;
}
/* 右侧小皇冠 */
div.flex.items-center.h-9.cursor-pointer.group::after,
div.h-9.rounded-md.cursor-pointer.group::after {
  content: "♛" !important;
  position: absolute !important;
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-52%) !important;
  font-size: 16px !important;
  color: #d4af37 !important;
  opacity: 0.45 !important;
  filter: drop-shadow(0 0 4px #d4af37) !important;
  pointer-events: none !important;
}
div.flex.items-center.h-9.cursor-pointer.group:hover,
div.h-9.rounded-md.cursor-pointer.group:hover {
  background: rgba(36, 16, 16, 0.9) !important;
  border-color: #d4af37 !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(180, 40, 40, 0.12) !important;
}
div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="SlidersH"] {
  color: #c49b4a !important;
}
div.flex.items-center.h-9.cursor-pointer.group svg[data-icon="ChevronDown"] {
  color: #b8860b !important;
}

/* --- 按钮栏：朱红鎏金渐变 --- */
#ai-mod-button2 button.MuiButton-root {
  background: linear-gradient(135deg, #8b1a1a, #b8860b) !important;
  border: none !important;
  color: #fff5e6 !important;
  border-radius: 22px !important;
  padding: 6px 18px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  box-shadow: 0 0 14px rgba(180, 40, 40, 0.4) !important;
  transition: all 0.3s ease !important;
}
#ai-mod-button2 button.MuiButton-root:hover {
  background: linear-gradient(135deg, #a52020, #cc9933) !important;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.5), 0 4px 16px rgba(0, 0, 0, 0.7) !important;
  transform: translateY(-2px) !important;
}
#ai-mod-button2 button.MuiButton-root svg {
  color: #fff5e6 !important;
  filter: drop-shadow(0 0 3px #d4af37) !important;
}

/* --- 底部栏：暗红深渊 + 凤尾纹 --- */
.bg-gradient-to-t {
  background: linear-gradient(to top, rgba(14, 4, 4, 0.98), rgba(22, 8, 8, 0.5), transparent) !important;
  /* 极淡的凤羽弧线 */
  background-image: 
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M10 50 Q30 20 50 50' fill='none' stroke='%23d4af37' stroke-width='0.6' opacity='0.07'/%3E%3Cpath d='M15 55 Q30 30 45 55' fill='none' stroke='%23b8860b' stroke-width='0.5' opacity='0.05'/%3E%3Ccircle cx='10' cy='50' r='1.5' fill='%23d4af37' opacity='0.08'/%3E%3Ccircle cx='50' cy='50' r='1.2' fill='%23d4af37' opacity='0.06'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat, repeat !important;
  background-position: 8% 90%, 0 0 !important;
  background-size: 60px 60px, auto !important;
}

#ai-chat-bottom-input {
  background: rgba(28, 12, 12, 0.8) !important;
  border-radius: 28px !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  box-shadow: 0 0 12px rgba(180, 40, 40, 0.12), inset 0 0 6px rgba(212, 175, 55, 0.05) !important;
  backdrop-filter: blur(12px) !important;
  transition: all 0.3s ease !important;
}
#ai-chat-bottom-input:focus-within {
  background: rgba(35, 15, 15, 0.9) !important;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.25), inset 0 0 8px rgba(180, 40, 40, 0.1) !important;
  border-color: #d4af37 !important;
}
#ai-chat-input {
  color: #f5e6d3 !important;
  caret-color: #d4af37 !important;
}
#ai-chat-input::placeholder {
  color: #7a5a4a !important;
  opacity: 0.7 !important;
}
#ai-chat-input::selection {
  background: rgba(180, 40, 40, 0.3) !important;
  color: #fff5e6 !important;
}

/* --- 分页栏：鎏金令牌 --- */
.MuiPaginationItem-root {
  color: #c49b4a !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
}
.MuiPaginationItem-root:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.25) !important;
}
.MuiPaginationItem-root.Mui-selected {
  background: linear-gradient(135deg, #8b1a1a, #b8860b) !important;
  border: none !important;
  color: #fff5e6 !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5) !important;
}
.MuiPaginationItem-root.Mui-disabled {
  opacity: 0.3 !important;
}
.MuiPaginationItem-icon {
  color: #d4af37 !important;
}
.MuiStack-root.css-1uwir8f .MuiBox-root {
  color: #c49b4a !important;
}
.MuiInputBase-input {
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 6px !important;
  background: rgba(20, 8, 8, 0.8) !important;
  color: #f5e6d3 !important;
}

/* --- 评论区：凤仪暗殿 + 金丝纹 --- */
div[class*="w-full"][class*="bg-white"][class*="bottom-0"] {
  background: linear-gradient(180deg, #1a0a0a 0%, #240e0e 100%) !important;
  /* 角落的金色凤羽暗纹 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Cpath d='M10 70 Q30 30 70 10' fill='none' stroke='%23d4af37' stroke-width='0.7' opacity='0.08'/%3E%3Cpath d='M15 75 Q35 40 75 20' fill='none' stroke='%23b8860b' stroke-width='0.5' opacity='0.05'/%3E%3Ccircle cx='70' cy='10' r='2' fill='%23d4af37' opacity='0.1'/%3E%3C/svg%3E") !important;
  background-size: 80px 80px !important;
  background-position: 100% 100% !important;
  background-repeat: no-repeat !important;
}
div.text-lg.font-bold {
  color: #f0d9b5 !important;
  font-weight: 700 !important;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.35) !important;
}
p.MuiTypography-body1.text-grey-600 {
  color: #b38b6b !important;
}
span.MuiRating-root {
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.5)) !important;
}
span.MuiRating-iconEmpty svg {
  color: #3a2222 !important;
  stroke: #5a3a2a !important;
}
span.MuiRating-iconFilled svg {
  color: #d4af37 !important;
  filter: drop-shadow(0 0 6px #d4af37) !important;
}
span.text-orange-500 {
  color: #d4af37 !important;
  font-weight: 600 !important;
}
div.flex.flex-col.border-gray-200 {
  background: rgba(28, 12, 12, 0.9) !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 14px rgba(180, 40, 40, 0.1) !important;
}
textarea.rc-textarea {
  color: #f5e6d3 !important;
  caret-color: #d4af37 !important;
}
textarea.rc-textarea::placeholder {
  color: #7a5a4a !important;
  opacity: 0.7 !important;
}
div.bg-gray-100.text-gray-500 {
  background: rgba(180, 40, 40, 0.15) !important;
  color: #d4af37 !important;
  border-radius: 10px !important;
}
div.cursor-pointer.group.flex.items-center.justify-center {
  color: #d4af37 !important;
  transition: all 0.2s ease !important;
}
div.cursor-pointer.group:hover {
  color: #f0c040 !important;
  background: rgba(212, 175, 55, 0.1) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4) !important;
}
div[data-state="closed"] svg[data-icon="Send03"] {
  color: #d4af37 !important;
  filter: drop-shadow(0 0 6px #d4af37) !important;
}
div.style_divider__mW0YX {
  border-color: rgba(212, 175, 55, 0.25) !important;
  opacity: 0.6 !important;
}
.MuiStack-root.css-1dmzxoz {
  gap: 8px !important;
}
button.MuiButton-outlinedPrimary {
  border-color: rgba(212, 175, 55, 0.5) !important;
  color: #c49b4a !important;
  border-radius: 20px !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
}
button.MuiButton-outlinedPrimary:hover {
  background: rgba(212, 175, 55, 0.12) !important;
  border-color: #d4af37 !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.3) !important;
}
button.MuiButton-containedPrimary {
  background: linear-gradient(135deg, #8b1a1a, #b8860b) !important;
  border: none !important;
  color: #fff5e6 !important;
  border-radius: 20px !important;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4) !important;
}
div.p-3.overflow-y-auto {
  background: transparent !important;
}
div.group.ml-0 {
  border-bottom: 1px solid rgba(212, 175, 55, 0.12) !important;
  padding: 12px 0 !important;
}
div.group img.rounded-full {
  border: 2px solid rgba(212, 175, 55, 0.5) !important;
  box-shadow: 0 0 12px rgba(180, 40, 40, 0.3) !important;
}
div.text-sm.text-grey-600 span.font-bold {
  color: #f0d9b5 !important;
}
span.text-\[10px\] {
  color: #f0c040 !important;
  background: rgba(180, 40, 40, 0.3) !important;
  border-radius: 4px !important;
  padding: 0 3px !important;
}
div.break-all {
  color: #f0e0cc !important;
}
div.text-xs.text-grey-600 {
  color: #8a5a4a !important;
}
button.text-gray-400 {
  color: #c49b4a !important;
  transition: all 0.2s !important;
}
button.text-gray-400:hover {
  color: #f0c040 !important;
  background: rgba(212, 175, 55, 0.1) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
}
button.text-gray-400 svg {
  color: inherit !important;
}
span.cursor-pointer {
  color: #d4af37 !important;
  font-weight: 600 !important;
}
span.cursor-pointer:hover {
  color: #f0c040 !important;
  text-decoration: underline wavy #b8860b !important;
}
div.ml-8.border-l {
  border-color: rgba(212, 175, 55, 0.3) !important;
}