@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary: #00e5ff;
    --primary-dim: #00a5b8;
    --accent: #7c4dff;
    --accent-glow: rgba(124, 77, 255, 0.4);
    --neon-green: #39ff14;
    --surface: rgba(8, 12, 24, 0.92);
    --surface-light: rgba(20, 30, 55, 0.85);
    --border: rgba(0, 229, 255, 0.15);
    --border-hover: rgba(0, 229, 255, 0.5);
    --text-primary: #e8eaf6;
    --text-secondary: #90a4ae;
    --bg-dark: #060a14;
    --card-bg: rgba(10, 18, 40, 0.88);
    --gradient-primary: linear-gradient(135deg, #00e5ff 0%, #7c4dff 100%);
    --gradient-surface: linear-gradient(180deg, rgba(10,18,40,0.95) 0%, rgba(6,10,20,0.98) 100%);
    --shadow-glow: 0 0 30px rgba(0,229,255,0.15), 0 0 60px rgba(124,77,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ======== 图片防盗基础防护 ======== */
img {
    -webkit-user-drag: none;  /* 禁用各种浏览器的图片拖拽功能 */
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -user-drag: none;
    
    -webkit-user-select: none; /* 禁用鼠标长按或双击选中图片 */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    pointer-events: auto; /* 保持图片本身可以被点击（如果不影响后续其他逻辑的话） */
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(0,229,255,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(124,77,255,0.03) 0%, transparent 50%),
        linear-gradient(rgba(0,229,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,255,0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 60px 60px, 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ======== 导航栏 ======== */
nav {
    height: 100px;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 10%;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.logo {
    /* 1. 字体选择：使用 Orbitron 字体，这是一种具有未来感的宽体无衬线字体 */
    font-family: "Orbitron", sans-serif;

    /* 2. 基础排版：字号 22px，字重 900 (最粗)，让 Logo 看起来厚重有力 */
    font-size: 20px; 
    font-weight: 900;

    /* 3. 背景设置：应用 CSS 变量中定义的主色调渐变（例如蓝紫渐变） */
    background: var(--gradient-primary);

    /* 4. 核心特效：将背景图片（渐变）裁剪到文字区域 */
    /* 注意：background-clip: text 是标准属性，但在部分浏览器需加前缀 */
    background-clip: text; 
    -webkit-background-clip: text;

    /* 5. 文字透明：将文字本身的颜色设为透明，从而透过文字显示出背景层的渐变色 */
    -webkit-text-fill-color: transparent;

    /* 6. 字间距：增加字母之间的距离 (3px)，营造高端、透气的视觉感 */
    letter-spacing: 4px; 

    /* 7. 文本转换：强制将所有字母转换为大写，增强 Logo 的正式感和冲击力 */
    text-transform: uppercase;
}


.nav-links { display: flex; gap: 8px; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 15px; font-weight: 500;
    padding: 8px 30px; border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    letter-spacing: 3px;
}
.nav-links a:hover { color: var(--primary); background: rgba(0,229,255,0.06); }
.nav-links a.active {
    color: #fff; background: var(--gradient-primary);
    box-shadow: 0 2px 20px rgba(0,229,255,0.3);
}

/* ======== 页面切换 ======== */
.page-section { display: none; min-height: calc(100vh - 80px); position: relative; z-index: 1; }

.page-section.active { display: block; animation: fadeSlideIn 0.6s cubic-bezier(0.4,0,0.2,1); }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ======== 首页 Hero ======== */
/* ======== 首页 Hero (平移版) ======== */
.hero-slider {
    width: 100%; height: calc(100vh - 80px);
    position: relative; overflow: hidden;
}
.slider-track {
    display: flex; width: 200%; height: 100%;
    /* 贝塞尔曲线让平移有一种科技设备的阻尼感 */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide {
    width: 50%; height: 100%; /* 因为总宽是200%，50%就是刚好一屏宽度 */
    background-size: cover; background-position: center;
    display: flex; align-items: center; padding: 0 8%;
    position: relative;
}
.slide::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(6,10,20,0.7) 0%, rgba(6,10,20,0.3) 50%, rgba(124,77,255,0.1) 100%);
    pointer-events: none;
}
.slide .hero-text { position: relative; z-index: 2; max-width: 680px; }
.slide .right-align { margin-left: auto; text-align: right; }

.hero-text h1 {
    font-family: "Orbitron", "Noto Sans SC", sans-serif;
    font-size: clamp(32px, 5vw, 56px); font-weight: 900;
    margin-bottom: 20px; line-height: 1.2; letter-spacing: 2px;
}
.hero-text h1 span {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-text p { font-size: 16px; color: var(--text-secondary); line-height: 1.8; max-width: 500px; }
.slide .right-align p { margin-left: auto; }

/* 科幻风底部横杠指示器 */
.slider-indicators {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 16px; z-index: 10;
}
.indicator {
    width: 40px; height: 4px; border-radius: 2px;
    background: rgba(0, 229, 255, 0.2);
    cursor: pointer; transition: all 0.4s ease;
}
.indicator:hover {
    background: rgba(0, 229, 255, 0.6);
}
.indicator.active {
    width: 64px;
    background: var(--primary);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.8);
}

/* ======== 案例模块 — zigzag 交错布局 ======== */
#cases { background: var(--gradient-surface); padding-bottom: 60px; }
#cases::before {
    content: ''; position: absolute; inset: 0;
    background: var(--bg-dark); opacity: 0.95; z-index: 0;
}
#cases > .container { position: relative; z-index: 1; }

.container { width: 88%; max-width: 1400px; margin: 0 auto; padding: 60px 0; }
.section-title {
    font-family: "Orbitron", "Noto Sans SC", sans-serif;
    font-size: 30px; font-weight: 700; margin-bottom: 50px;
    padding-left: 20px;
    border-left: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
    letter-spacing: 2px;
}
.section-title span { color: var(--text-secondary); font-weight: 300; font-size: 16px; letter-spacing: 4px; }

.case-list { display: flex; flex-direction: column; gap: 48px; }

.case-item {
    display: flex; flex-direction: row; align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border); border-radius: 64px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}
.case-item:nth-child(even) { flex-direction: row-reverse; }
.case-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary); opacity: 0; transition: opacity 0.4s;
}
.case-item:hover {
    border-color: var(--border-hover); transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
}
.case-item:hover::before { opacity: 1; }

.case-img-box { width: 55%; min-height: 420px; overflow: hidden; flex-shrink: 0; }
.case-img-box img {
    width: 100%; height: 100%; object-fit: cover; min-height: 420px;
    transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.case-item:hover .case-img-box img { transform: scale(1.05); }

.case-info { padding: 50px 48px; flex: 1; display: flex; flex-direction: column; justify-content: center; }

.case-info h3 {
    font-size: 28px; font-weight: 600; margin-bottom: 40px;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.case-info p { font-size: 17px; color: var(--text-secondary); line-height: 1.9; flex: 1; }

/* ======== 联系表单 ======== */
#contact { background: var(--gradient-surface); position: relative; }
#contact::before { content: ''; position: absolute; inset: 0; background: var(--bg-dark); opacity: 0.95; }
#contact > .container { position: relative; z-index: 1; }
.contact-card {
    max-width: 580px; margin: 0 auto;
    background: var(--card-bg); padding: 50px 44px;
    border: 1px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow-glow); position: relative; overflow: hidden;
}
.contact-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-primary);
}
.contact-card h2 {
    text-align: center; margin-bottom: 36px;
    font-family: "Orbitron", "Noto Sans SC", sans-serif;
    font-size: 24px; font-weight: 700; letter-spacing: 2px;
}
.form-group { margin-bottom: 24px; }
.form-group label {
    display: block; margin-bottom: 8px; color: var(--text-secondary);
    font-size: 13px; font-weight: 500; letter-spacing: 1px;
}
input, select, textarea {
    width: 100%; padding: 14px 16px;
    background: rgba(0,229,255,0.04);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-primary); font-size: 14px; font-family: inherit;
    transition: all 0.3s; outline: none;
}
input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,229,255,0.1);
    background: rgba(0,229,255,0.06);
}
input::placeholder, textarea::placeholder { color: rgba(144,164,174,0.5); }
.submit-btn {
    width: 100%; padding: 16px;
    background: var(--gradient-primary);
    color: #fff; border: none; border-radius: 8px;
    cursor: pointer; font-weight: 700; font-size: 15px;
    letter-spacing: 2px; transition: all 0.3s;
    font-family: inherit; margin-top: 8px;
}
.submit-btn:hover { box-shadow: 0 4px 30px rgba(0,229,255,0.35); transform: translateY(-2px); }
.submit-btn:active { transform: translateY(0); }

/* ======== 页脚 ======== */
footer {
    min-height: 260px; background-size: cover; background-position: center;
    padding: 50px 6%; display: flex; align-items: center;
    position: relative; z-index: 1;
}
footer::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(6,10,20,0.85) 30%, rgba(6,10,20,0.7) 100%);
    z-index: -1;
}
.footer-inner {
    display: flex; justify-content: space-between;
    width: 100%; max-width: 1400px; margin: 0 auto; align-items: center;
}
.footer-left h3 {
    font-family: "Orbitron", "Noto Sans SC", sans-serif;
    font-size: 20px; margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.footer-left p { color: var(--text-secondary); font-size: 15px; line-height: 2; }
.footer-right { text-align: center; }
.footer-right p { color: var(--text-secondary); font-size: 12px; margin-top: 8px; }
.qr-code { width: 100px; border: 1px solid var(--border); border-radius: 8px; }


/* ======== ICP 备案号样式 ======== */
.footer-icp {
    position: absolute;
    bottom: 20px; /* 距离底部 20px 的呼吸空间 */
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 2; /* 确保层级在渐变遮罩之上，保证可点击 */
}

.footer-icp a {
    color: var(--text-secondary); /* 默认使用次要文字颜色，低调不抢戏 */
    font-size: 13px;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-icp a:hover {
    color: var(--primary); /* 鼠标悬浮时，点亮成你的主题青色 */
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4); /* 增加微弱发光科技感 */
}


/* ======== 气泡轨迹 ======== */
.bubble-trail {
    position: fixed; border-radius: 50%; pointer-events: none; z-index: 9990;
    animation: bubbleFade 5s ease-out forwards;
}
@keyframes bubbleFade {
    0%   { transform: scale(1);   opacity: 1; }
    25%  { transform: scale(1.4); opacity: 0.85; }
    50%  { transform: scale(2);   opacity: 0.45; }
    100% { transform: scale(4);   opacity: 0; }
}

/* ★ 烟花爆炸气泡 */
.firework-bubble {
    position: fixed; border-radius: 50%; pointer-events: none; z-index: 9990;
    animation: fireworkBurst 2s ease-out forwards;
}
@keyframes fireworkBurst {
    0%   { transform: translate(0,0) scale(1); opacity: 1; }
    30%  { opacity: 0.85; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* ======== 聊天浮动按钮 ======== */
.chatbot-toggle {
    position: fixed; width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #87CEEB 0%, #00e5ff 100%);
    border: none; cursor: pointer; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 24px rgba(0,229,255,0.5), 0 0 60px rgba(124,77,255,0.25);
    transition: box-shadow 0.3s;
    will-change: left, top;
}
.chatbot-toggle:hover {
    box-shadow: 0 4px 40px rgba(0,229,255,0.7), 0 0 80px rgba(124,77,255,0.4);
}
.chatbot-toggle svg { width: 28px; height: 28px; fill: #fff; }
.chatbot-toggle.docked {
    bottom: 24px !important; right: 24px !important;
    left: auto !important; top: auto !important;
    transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* ======== 聊天窗口 ======== */
.chatbot-window {
    position: fixed; bottom: 24px; right: 24px;
    width: 50vw; min-width: 300px; max-width: 500px;
    height: 75vh; max-height: 3600px;
    background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 16px;
    z-index: 10000;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 8px 60px rgba(0,0,0,0.6), var(--shadow-glow);
    transform: scale(0) translateY(20px);
    transform-origin: bottom right;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
    pointer-events: none;
}
.chatbot-window.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0,229,255,0.12), rgba(124,77,255,0.12));
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-header-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient-primary);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; /* ★ 新增：这行极其关键，把超出圆圈的方形图片边缘“喀嚓”剪掉 */
}
.chat-header-avatar svg { width: 18px; height: 18px; fill: #fff; }

/* ★ 新增：专门控制替换后的头像图片，确保不拉伸变形 */
.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保证图片等比例缩放填满整个圆圈，不会变扁或变瘦 */
    display: block;
}

.chat-header-info h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.chat-header-info p { font-size: 11px; color: var(--neon-green); }
.chat-close-btn {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; font-size: 18px;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.chat-body {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
    max-width: 85%; padding: 10px 16px; border-radius: 14px;
    font-size: 13px; line-height: 1.6;
    animation: msgSlide 0.3s ease;
    word-wrap: break-word;
}
@keyframes msgSlide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
    align-self: flex-start;
    background: rgba(0,229,255,0.08);
    border: 1px solid rgba(0,229,255,0.12);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    white-space: normal; /* ★ 新增：机器人输出的 HTML 走正常渲染 */
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap; /* ★ 新增：用户的纯文本依然保留原样换行 */
}
.chat-msg.system {
    align-self: center;
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.25);
    color: #ffb74d; font-size: 12px;
    text-align: center; border-radius: 8px;
}

/* ★ 打字机光标 */

.cursor-blink {
    color: var(--primary);
    animation: cursorBlink 0.6s step-end infinite;
    margin-left: 2px;
    display: inline-block;       /* 确保它是行内块 */
    vertical-align: baseline;    /* 保证和文字底部完美对齐 */
}

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

.chat-loading {
    align-self: flex-start;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: rgba(0,229,255,0.06);
    border: 1px solid rgba(0,229,255,0.1);
    border-radius: 14px; border-bottom-left-radius: 4px;
    animation: msgSlide 0.3s ease;
}
.chat-loading .spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(0,229,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.chat-loading .loading-text { color: var(--text-secondary); font-size: 12px; }

.chat-input-area {
    padding: 14px 16px; border-top: 1px solid var(--border);
    display: flex; gap: 10px; flex-shrink: 0;
    background: rgba(6,10,20,0.6);
}
.chat-input-area input {
    flex: 1; padding: 10px 14px;
    background: rgba(0,229,255,0.04);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text-primary); font-size: 13px;
    outline: none; font-family: inherit;
    transition: border-color 0.3s;
}
.chat-input-area input:focus { border-color: var(--primary); }
.chat-input-area input:disabled { opacity: 0.5; cursor: not-allowed; }
.chat-send-btn {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--gradient-primary);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: box-shadow 0.3s, transform 0.2s;
}
.chat-send-btn:hover { box-shadow: 0 2px 16px rgba(0,229,255,0.4); transform: scale(1.05); }
.chat-send-btn svg { width: 18px; height: 18px; fill: #fff; }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.chat-quota-bar {
    padding: 6px 16px;
    background: rgba(0,229,255,0.04);
    border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-secondary);
    text-align: center; flex-shrink: 0;
}

/* ======== 响应式 ======== */
@media (max-width: 1100px) {
    .case-img-box { min-height: 340px; }
    .case-img-box img { min-height: 340px; }
}
@media (max-width: 768px) {
    nav { padding: 0 4%; height: 64px; }
    .logo { font-size: 16px; }
    .nav-links a { font-size: 12px; padding: 6px 14px; }
    .hero-text h1 { font-size: 28px; }
    .case-item, .case-item:nth-child(even) { flex-direction: column; }
    .case-img-box { width: 100%; min-height: 260px; }
    .case-img-box img { min-height: 260px; }
    .case-info { padding: 24px; }
    .container { width: 92%; padding: 40px 0; }
    .contact-card { padding: 30px 24px; }
    .chatbot-window {
        width: 92vw; min-width: unset; max-width: unset;
        height: 65vh; bottom: 12px; right: 4vw;
    }
    .footer-inner { flex-direction: column; gap: 30px; text-align: center; }
    .flip-back .hero-text { text-align: left; }
    .flip-back .hero-text p { margin-left: 0; }
    .flip-back { justify-content: flex-start; }
}

/* ================================================================
   ★ 聊天机器人 Markdown 渲染排版精修 (升级版) ★
   ================================================================ */

/* 1. 全局段落与行高优化 */
.chat-msg.bot {
    line-height: 1.6; /* 提高整体易读性 */
}
.chat-msg.bot p {
    margin-bottom: 2px; /* 增加段落间距 */
}
.chat-msg.bot p:last-child {
    margin-bottom: 0;
}

/* 2. 标题样式提升 (解决标题不明显问题) */
.chat-msg.bot h1, .chat-msg.bot h2, .chat-msg.bot h3 {
    margin-top: 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-weight: 700;
}
.chat-msg.bot h1 { font-size: 1.4em; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.chat-msg.bot h2 { font-size: 1.25em; }
.chat-msg.bot h3 { font-size: 1.15em; }

/* 3. 列表样式深度提升 (解决点太小和缩进问题) */
.chat-msg.bot ul, .chat-msg.bot ol {
    padding-left: 25px; /* 增加缩进 */
    margin-bottom: 15px; /* 增加底部外边距 */
}
.chat-msg.bot li {
    margin-bottom: 8px; /* 增加列表项间距 */
}
/* 自定义无序列表符号，使其更大醒目，并使用荧光绿 */
.chat-msg.bot ul li::marker {
    color: var(--neon-green);
    font-size: 1.2em;
}

/* 4. 代码块样式重塑 (解决看着“差”的核心痛点) */
.chat-msg.bot pre {
    background-color: rgba(0, 0, 0, 0.4); /* 更深的半透明背景，与气泡区分 */
    border: 1px solid var(--border); /* 添加边框 */
    border-radius: 8px; /* 圆角 */
    padding: 15px; /* 充足内边距 */
    margin: 15px 0; /* 外边距 */
    overflow-x: auto; /* 允许横向滚动 */
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.05); /* 微妙的科技内发光 */
}
/* 代码块中的代码文本 */
.chat-msg.bot pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace; /* 强制使用等宽字体 */
    font-size: 13px;
    color: var(--text-secondary); /* 基础代码颜色 */
    background: transparent; /* 去掉 pre 里面的 code 背景 */
    padding: 0;
}

/* 行内代码 (`...`) 的精致样式 */
.chat-msg.bot :not(pre) > code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: rgba(124, 77, 255, 0.1); /* 微妙的紫色背景，突出显示 */
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ================================================================
   ★ 数学公式 KaTeX 样式优化
   ================================================================ */
/* 处理块级公式（$$ 包含的公式），允许横向滚动 */
.chat-msg.bot .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    margin: 10px 0;
}

/* 自定义公式滚动条，保持科技感 */
.chat-msg.bot .katex-display::-webkit-scrollbar {
    height: 4px;
}
.chat-msg.bot .katex-display::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* 确保行内公式（$ 包含的公式）换行时不会断成两截 */
.chat-msg.bot .katex {
    white-space: nowrap;
}

/* 5. 聊天气泡内的图片样式（专为二维码或配图设计） */
.chat-msg.bot img {
    max-width: 120px; /* 限制最大宽度，防止撑爆气泡，160px 扫码刚刚好 */
    width: 100%;
    height: auto;
    border-radius: 8px; /* 给图片加个圆角，契合科技感 */
    margin-top: 12px;
    margin-bottom: 4px;
    border: 1px solid var(--border); /* 加上科技感边框 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: block;
    cursor: pointer; /* 提示用户图片可以点击（可选） */
}