/* ==================== AI 百科弹窗对话框样式 (UI UX Pro Max) ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Pro Max Palette */
    --wiki-primary: #8b5cf6;
    /* Violet 500 */
    --wiki-primary-glow: rgba(139, 92, 246, 0.5);
    --wiki-secondary: #ec4899;
    /* Pink 500 */
    --wiki-bg: rgba(15, 23, 42, 0.85);
    /* Slate 900 with opacity */
    --wiki-bg-solid: #0f172a;
    --wiki-surface: rgba(30, 41, 59, 0.7);
    /* Slate 800 */
    --wiki-surface-hover: rgba(51, 65, 85, 0.8);
    /* Slate 700 */
    --wiki-border: rgba(255, 255, 255, 0.1);
    --wiki-border-highlight: rgba(255, 255, 255, 0.15);

    --wiki-text: #f8fafc;
    /* Slate 50 */
    --wiki-text-secondary: #94a3b8;
    /* Slate 400 */
    --wiki-text-muted: #64748b;
    /* Slate 500 */

    --wiki-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --wiki-shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);

    --wiki-radius-lg: 24px;
    --wiki-radius-md: 16px;
    --wiki-radius-sm: 8px;

    --wiki-font: 'Inter', system-ui, -apple-system, sans-serif;
    --wiki-anim-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --wiki-anim-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 弹窗容器 ==================== */

.wiki-widget-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--wiki-anim-smooth);
}

.wiki-widget-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.wiki-widget-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 900px;
    height: 85vh;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);

    /* Premium Glass Effect */
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--wiki-border);
    box-shadow: var(--wiki-shadow-lg),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Inner border for depth */

    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border-radius: var(--wiki-radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    font-family: var(--wiki-font);
}

/* Aurora Background Effects */
.wiki-widget-container::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.wiki-widget-container::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.wiki-widget-container.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* ==================== 头部 ==================== */

.wiki-widget-header {
    position: relative;
    padding: 20px 24px;
    background: rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid var(--wiki-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.wiki-widget-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wiki-widget-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.25);
    position: relative;
}

.wiki-widget-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    opacity: 0.4;
    filter: blur(4px);
    z-index: -1;
}

.wiki-widget-avatar i {
    font-size: 1.25rem;
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* AI Badge - Inline with text */
.wiki-widget-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 8px;
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
    vertical-align: text-top;
    position: relative;
    top: -1px;
}

.wiki-widget-title-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--wiki-text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
}

.wiki-widget-subtitle {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    color: var(--wiki-text-secondary);
    font-weight: 400;
}

.wiki-widget-header-actions {
    display: flex;
    gap: 8px;
}

.wiki-widget-clear-btn,
.wiki-widget-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.05);
    color: var(--wiki-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--wiki-anim-fast);
}

.wiki-widget-clear-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.wiki-widget-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* ==================== 消息区域 ==================== */

.wiki-widget-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    z-index: 5;
}

/* Custom Scrollbar */
.wiki-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.wiki-widget-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wiki-widget-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.wiki-widget-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== 欢迎区域 ==================== */

.wiki-widget-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInUuid 0.6s ease-out;
}

@keyframes fadeInUuid {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wiki-widget-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    position: relative;
    animation: floatIcon 6s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.wiki-widget-welcome-icon i {
    font-size: 1.8rem;
    color: #fff;
}

.wiki-widget-welcome-text {
    font-size: 1rem;
    color: var(--wiki-text);
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 320px;
    font-weight: 500;
}

.wiki-widget-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 500px;
}

.wiki-widget-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--wiki-surface);
    border: 1px solid var(--wiki-border);
    border-radius: 100px;
    /* Pill shape */
    color: var(--wiki-text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wiki-widget-quick-btn:hover {
    background: var(--wiki-surface-hover);
    border-color: var(--wiki-primary-glow);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.wiki-widget-quick-btn i {
    font-size: 0.8rem;
    color: var(--wiki-primary);
}

/* ==================== 消息气泡 ==================== */

.wiki-widget-msg {
    display: flex;
    gap: 16px;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wiki-widget-msg.user {
    flex-direction: row-reverse;
}

.wiki-widget-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wiki-widget-msg.user .wiki-widget-msg-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.wiki-widget-msg.assistant .wiki-widget-msg-avatar {
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    color: #fff;
}

.wiki-widget-msg-content {
    max-width: 80%;
    min-width: 40px;
    display: flex;
    flex-direction: column;
}

.wiki-widget-msg.user .wiki-widget-msg-content {
    align-items: flex-end;
}

.wiki-widget-msg-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.65;
    font-size: 0.92rem;
    position: relative;
}

/* User Bubble */
.wiki-widget-msg.user .wiki-widget-msg-bubble {
    background: linear-gradient(135deg, var(--wiki-primary), #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* AI Bubble */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble {
    background: var(--wiki-surface);
    border: 1px solid var(--wiki-border);
    color: var(--wiki-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==================== Markdown Content ==================== */

.wiki-widget-msg.assistant .wiki-widget-msg-bubble h1,
.wiki-widget-msg.assistant .wiki-widget-msg-bubble h2,
.wiki-widget-msg.assistant .wiki-widget-msg-bubble h3 {
    margin: 1.5em 0 0.8em;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble h1:first-child,
.wiki-widget-msg.assistant .wiki-widget-msg-bubble h2:first-child,
.wiki-widget-msg.assistant .wiki-widget-msg-bubble h3:first-child {
    margin-top: 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble p {
    margin: 0.8em 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble p:first-child {
    margin-top: 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble p:last-child {
    margin-bottom: 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble strong {
    color: var(--wiki-primary);
    font-weight: 600;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: #fca5a5;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble pre {
    background: #0f172a;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble ul {
    padding-left: 1.5em;
    margin: 0.8em 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble li {
    margin: 0.4em 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble li::marker {
    color: var(--wiki-primary);
}

/* ==================== Sources ==================== */

.wiki-widget-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.wiki-widget-source-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.75rem;
    color: #a5b4fc;
    transition: all 0.2s;
}

.wiki-widget-source-tag:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

/* ==================== Typing Indicator ==================== */

.wiki-widget-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--wiki-surface);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    border: 1px solid var(--wiki-border);
}

.wiki-widget-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wiki-text-secondary);
    animation: bounce 1.4s infinite ease-in-out both;
}

.wiki-widget-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.wiki-widget-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ==================== Input Area ==================== */

.wiki-widget-input-area {
    padding: 20px 24px 24px;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--wiki-border);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.wiki-widget-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--wiki-border);
    border-radius: 20px;
    padding: 8px;
    transition: all var(--wiki-anim-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wiki-widget-input-wrapper:focus-within {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--wiki-primary);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.wiki-widget-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--wiki-text);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 10px 14px;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    font-family: inherit;
}

.wiki-widget-input::placeholder {
    color: var(--wiki-text-muted);
}

.wiki-widget-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: none;
    background: var(--wiki-surface);
    color: var(--wiki-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--wiki-anim-fast);
}

.wiki-widget-send-btn.active {
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.wiki-widget-send-btn.active:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .wiki-widget-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(20px);
        opacity: 0;
    }

    .wiki-widget-container.active {
        transform: translateY(0);
        opacity: 1;
    }

    .wiki-widget-header {
        padding: 16px;
        padding-top: calc(16px + env(safe-area-inset-top));
    }

    .wiki-widget-input-area {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .wiki-widget-messages {
        padding: 16px;
    }
}

/* AI Badge - Positioned relative to avatar */
.wiki-widget-badge {
    position: absolute;
    bottom: -6px;
    right: -8px;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--wiki-primary), var(--wiki-secondary));
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
    z-index: 2;
    border: 2px solid rgba(15, 23, 42, 0.8);
    /* Match background for cutout effect */
}
/* AI Badge Fix - Force inline positioning */
.wiki-widget-badge {
    position: static !important;
    display: inline-block !important;
    vertical-align: middle !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    margin-left: 8px !important;
    transform: translateY(-2px); /* Slight optical adjustment */
    border: none !important;
}

/* Ensure header info uses flex to align avatar and text group */
.wiki-widget-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Ensure title row behaves as a block or flex container for text */
.wiki-widget-title-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==================== Markdown Table Styles (UI UX Pro Max) ==================== */

.wiki-widget-msg.assistant .wiki-widget-msg-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.9em;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: rgba(15, 23, 42, 0.4); /* 深色背景，匹配整体风格 */
    border: 1px solid var(--wiki-border);
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble thead {
    background: rgba(139, 92, 246, 0.15); /* 主要是紫色调，稍微透明 */
    border-bottom: 2px solid var(--wiki-border-highlight);
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #fff; /* 表头文字更亮 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85em;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--wiki-border);
    color: var(--wiki-text);
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble tr:last-child td {
    border-bottom: none;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03); /* 偶数行轻微高亮，增加可读性 */
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble tr:hover {
    background: rgba(255, 255, 255, 0.08); /* 悬停效果 */
    transition: background 0.2s ease;
}

/* 移动端表格横向滚动 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble {
    overflow-x: auto; /* 允许气泡内容横向滚动 */
}

/* ==================== Markdown List Styles (Ordered & Unordered) ==================== */

.wiki-widget-msg.assistant .wiki-widget-msg-bubble ol {
    padding-left: 1.5em; /* 保持与 ul 对齐 */
    margin: 0.8em 0;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble ol li {
    margin: 0.4em 0;
    padding-left: 0.2em; /* 数字标记和文本之间留点空隙 */
}

/* 增强数字标记的可读性 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble ol li::marker {
    color: var(--wiki-primary); /* 使用主题色，显得更专业 */
    font-weight: 600;
    font-family: var(--wiki-font);
}

/* 确保嵌套列表也有正确的间距 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble li > ul,
.wiki-widget-msg.assistant .wiki-widget-msg-bubble li > ol {
    margin: 0.4em 0;
}

/* ==================== Table Column Optimization ==================== */

/* 表头内容不换行，且给予最小宽度，避免挤压 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble th {
    white-space: nowrap;
    min-width: 80px;
}

/* 单元格也给予最小宽度，特别是对那些简短但不想被挤成两行的内容 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble td {
    min-width: 80px;
}

/* 第一列往往是标题或编号，稍微加宽一点，并尝试不换行（如果内容不多） */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble td:first-child {
    white-space: nowrap;
}

/* 但如果第一列内容太长，还是允许换行，覆盖上面的规则 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble td:first-child {
    white-space: normal; /* 重新允许换行，主要靠min-width支撑 */
    min-width: 100px;    /* 第一列稍微宽一点 */
    font-weight: 500;    /* 原来的设计是稍微加粗，这里保持 */
}

/* ==================== HR & Highlight Styles (Optimized) ==================== */

/* 优雅的分隔线，两端渐变消失 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    margin: 2em 0;
}

/* 优化的高亮文字：增加背景色，使其像荧光笔一样，但符合深色主题 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble strong {
    color: #fff; /* 文字改回白色，保证对比度 */
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3)); /* 紫粉渐变背景 */
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

/* ==================== Visual Optimization Updates ==================== */

/* 更新根变量，调暗主文字颜色 */
:root {
    /* 将原本的 --wiki-text 从 #f8fafc (Slate 50) 调暗到 #e2e8f0 (Slate 200)，更柔和 */
    --wiki-text: #e2e8f0;
}

/* 优化普通文本段落，稍微降低对比度 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble p {
    color: var(--wiki-text);
    line-height: 1.7; /* 增加行高，提升阅读舒适度 */
}

/* 优化高亮文字：去除过于刺眼的背景色，改为渐变文字色+底部高亮条 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble strong {
    background: none;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    background-image: linear-gradient(135deg, #a78bfa, #f472b6); /* 柔和的紫粉渐变 */
    font-weight: 700;
    padding: 0 2px;
    box-shadow: none;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3); /* 仅保留底部强调 */
}

/* 优化列表项文字 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble li {
    color: var(--wiki-text);
}

/* 优化表格文字颜色 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble td {
    color: var(--wiki-text);
}

/* 表头保持稍微亮一点，但不要纯白 */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble th {
    color: #f1f5f9; /* Slate 100 */
    font-weight: 600;
}

/* 链接颜色优化（如果有） */
.wiki-widget-msg.assistant .wiki-widget-msg-bubble a {
    color: #a78bfa; /* Violet 400 */
    text-decoration: none;
    border-bottom: 1px dashed rgba(167, 139, 250, 0.5);
    transition: all 0.2s;
}

.wiki-widget-msg.assistant .wiki-widget-msg-bubble a:hover {
    color: #c4b5fd; /* Violet 300 */
    border-bottom-style: solid;
}
