/* ============================================================
   开放宇宙·万象之书 — CSS 美化
   主题：深空星穹 · 鎏金神谕
   适配：AI风月(Acquainte) / 绘星 / 酒馆类平台
   ============================================================ */

/* ==================== 基础设置 ==================== */
* {
    box-sizing: border-box;
}

body, .grow.overflow-hidden {
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3e 40%, #0d0d2b 100%) !important;
    position: relative;
    color: #e0e0f0 !important;
}

/* 星空背景纹理 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(212,165,116,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(212,165,116,0.3), transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 250px 90px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 300px 60px, rgba(212,165,116,0.15), transparent);
    background-repeat: repeat;
    background-size: 320px 160px;
    pointer-events: none;
    z-index: 0;
    animation: starDrift 120s linear infinite;
}

@keyframes starDrift {
    from { background-position: 0 0; }
    to { background-position: 320px 160px; }
}

/* ==================== 字体 ==================== */
* {
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", "Microsoft YaHei", serif !important;
}

p {
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif !important;
    font-size: 16px;
    line-height: 1.9;
    margin: 12px 14px;
    letter-spacing: 0.3px;
    color: #d8d8e8;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Noto Serif SC", "Source Han Serif SC", "KaiTi", serif !important;
    color: #d4a574 !important;
    text-shadow: 0 0 12px rgba(212,165,116,0.3);
}

h1 {
    font-size: 1.6em;
    border-bottom: 1px solid rgba(212,165,116,0.3);
    padding-bottom: 0.4em;
    margin-top: 0.5em;
}

h2 { font-size: 1.35em; }
h3 { font-size: 1.15em; }

font {
    font-family: inherit !important;
}

/* ==================== 对话气泡美化 (AI侧) ==================== */
.chat-answer-container .relative.inline-block,
.group .bg-gray-100\/90 {
    background: linear-gradient(135deg, rgba(20,20,50,0.92) 0%, rgba(30,25,60,0.92) 100%) !important;
    border: 1px solid rgba(212,165,116,0.35) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 20px rgba(212,165,116,0.08), inset 0 0 30px rgba(212,165,116,0.03) !important;
    color: #d8d8e8 !important;
    padding: 16px 18px !important;
    backdrop-filter: blur(6px);
}

/* 用户消息气泡 */
.relative.inline-block.px-4.py-3.max-w-full.text-gray-900.bg-gray-100\/90 {
    background: linear-gradient(135deg, rgba(40,35,70,0.9) 0%, rgba(50,40,80,0.9) 100%) !important;
    border: 1px solid rgba(140,120,200,0.35) !important;
    color: #e8e8f0 !important;
    box-shadow: 0 0 15px rgba(140,120,200,0.1) !important;
}

/* ==================== 平台按钮美化 ==================== */
.flex.items-center.gap-2.pb-2 > button,
.MuiButton-outlined {
    background: linear-gradient(135deg, rgba(30,28,60,0.9) 0%, rgba(40,35,70,0.9) 100%) !important;
    color: #d4a574 !important;
    border: 1px solid rgba(212,165,116,0.4) !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    transition: all 0.25s ease !important;
    padding: 6px 14px !important;
    backdrop-filter: blur(4px);
}

.flex.items-center.gap-2.pb-2 > button:hover,
.MuiButton-outlined:hover {
    background: linear-gradient(135deg, rgba(212,165,116,0.2) 0%, rgba(212,165,116,0.1) 100%) !important;
    color: #f0d9b5 !important;
    border-color: rgba(212,165,116,0.7) !important;
    box-shadow: 0 0 12px rgba(212,165,116,0.2) !important;
    transform: translateY(-1px);
}

/* ==================== 输入栏美化 ==================== */
#ai-chat-input {
    background: rgba(15,15,35,0.85) !important;
    border: 1px solid rgba(212,165,116,0.3) !important;
    border-radius: 8px !important;
    color: #e0e0f0 !important;
    font-family: "Noto Serif SC", serif !important;
}

#ai-chat-input::placeholder {
    color: rgba(212,165,116,0.4) !important;
}

#ai-chat-input:focus {
    border-color: rgba(212,165,116,0.7) !important;
    box-shadow: 0 0 15px rgba(212,165,116,0.15) !important;
    outline: none !important;
}

#ai-chat-bottom-input,
.p-\[5\.5px\].max-h-\[150px\].bg-white {
    background: rgba(10,10,25,0.8) !important;
    border: 1px solid rgba(212,165,116,0.2) !important;
    backdrop-filter: blur(8px);
}

/* 发送按钮 */
#ai-send-button {
    background: linear-gradient(135deg, #d4a574 0%, #b8864a 100%) !important;
    transition: all 0.3s ease !important;
}
#ai-send-button:hover {
    box-shadow: 0 0 20px rgba(212,165,116,0.5) !important;
    transform: scale(1.05);
}

/* ==================== 折叠状态栏美化 ==================== */
details {
    background: rgba(15,15,35,0.7) !important;
    border: 1px solid rgba(212,165,116,0.25) !important;
    border-radius: 8px !important;
    padding: 0.8em 1em !important;
    margin: 1em 0 !important;
    backdrop-filter: blur(4px);
}

summary {
    color: #d4a574 !important;
    font-size: 1.05em !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 0.3em 0 !important;
    letter-spacing: 1px;
}

summary:hover {
    color: #f0d9b5 !important;
    text-shadow: 0 0 8px rgba(212,165,116,0.4);
}

details[open] summary {
    border-bottom: 1px solid rgba(212,165,116,0.2) !important;
    padding-bottom: 0.6em !important;
    margin-bottom: 0.6em !important;
}

/* ==================== 分割线 ==================== */
hr {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(212,165,116,0.4), transparent) !important;
    margin: 1.2em 0 !important;
}

/* ==================== 表格美化 ==================== */
table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0.8em 0 !important;
    font-size: 0.92em !important;
}

th {
    background: rgba(212,165,116,0.15) !important;
    color: #d4a574 !important;
    border: 1px solid rgba(212,165,116,0.3) !important;
    padding: 8px 10px !important;
    font-weight: 600 !important;
}

td {
    border: 1px solid rgba(212,165,116,0.15) !important;
    padding: 7px 10px !important;
    color: #c8c8d8 !important;
}

tr:nth-child(even) td {
    background: rgba(255,255,255,0.02) !important;
}

tr:hover td {
    background: rgba(212,165,116,0.06) !important;
}

/* ==================== 引用块 ==================== */
blockquote {
    border-left: 3px solid rgba(212,165,116,0.5) !important;
    background: rgba(212,165,116,0.05) !important;
    margin: 1em 0 !important;
    padding: 0.6em 1em !important;
    border-radius: 0 6px 6px 0 !important;
    color: #b8b8c8 !important;
}

/* ==================== 代码块 ==================== */
pre, code {
    background: rgba(10,10,25,0.8) !important;
    border: 1px solid rgba(212,165,116,0.2) !important;
    border-radius: 6px !important;
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace !important;
}

pre {
    padding: 1em !important;
    overflow-x: auto !important;
}

code {
    padding: 2px 6px !important;
    color: #e0c8a0 !important;
    font-size: 0.9em !important;
}

/* ==================== 列表 ==================== */
li {
    font-family: "Noto Serif SC", serif !important;
    color: #c8c8d8 !important;
    margin: 4px 0 !important;
    line-height: 1.7 !important;
}

ul, ol {
    padding-left: 1.5em !important;
}

/* ==================== 链接 ==================== */
a {
    color: #d4a574 !important;
    text-decoration: none !important;
    border-bottom: 1px dashed rgba(212,165,116,0.3);
    transition: all 0.2s;
}
a:hover {
    color: #f0d9b5 !important;
    border-bottom-color: rgba(212,165,116,0.7);
}

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}
::-webkit-scrollbar-track {
    background: rgba(10,10,25,0.5) !important;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212,165,116,0.4), rgba(184,134,74,0.4)) !important;
    border-radius: 4px !important;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(212,165,116,0.7), rgba(184,134,74,0.7)) !important;
}

/* ==================== 侧边栏 ==================== */
.relative.overflow-auto.h-full.min-h-\[500px\].min-w-\[240px\].bg-white {
    background: linear-gradient(180deg, rgba(15,15,35,0.95) 0%, rgba(20,18,45,0.95) 100%) !important;
    border-right: 1px solid rgba(212,165,116,0.2) !important;
}

.text-zinc-800.text-xl.font-semibold {
    color: #d4a574 !important;
    text-shadow: 0 0 10px rgba(212,165,116,0.3) !important;
}

/* ==================== 顶部导航栏 ==================== */
.sticky.w-full.top-0 {
    background: rgba(10,10,25,0.85) !important;
    border-bottom: 1px solid rgba(212,165,116,0.2) !important;
    backdrop-filter: blur(10px) !important;
}

/* ==================== 加载动画美化 ==================== */
.style_dot-flashing__8L91Q,
.flex.items-center.justify-center.w-6.h-5 {
    font-size: 0 !important;
}
.flex.items-center.justify-center.w-6.h-5::after {
    content: "✦ 万象流转 ✦" !important;
    font-size: 13px !important;
    color: #d4a574 !important;
    letter-spacing: 2px;
    animation: pulseGlow 2s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; text-shadow: 0 0 5px rgba(212,165,116,0.3); }
    50% { opacity: 1; text-shadow: 0 0 15px rgba(212,165,116,0.6); }
}

/* ==================== 加粗/强调 ==================== */
strong, b {
    color: #e8d5b0 !important;
    font-weight: 700 !important;
}

em, i {
    color: #c8b8e0 !important;
}

/* ==================== memory标签隐藏 ==================== */
memory {
    display: none !important;
}

/* ==================== 选中文字 ==================== */
::selection {
    background: rgba(212,165,116,0.3) !important;
    color: #fff !important;
}
