/* ===== 高端 AI 客服聊天窗口 ===== */
.ai-assistant {
    /* 右下角零尺寸锚点：悬浮图标与聊天窗口均相对视口右下角定位 */
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    z-index: 9990;
    /* 含 Emoji 字体回退，确保表情在各类浏览器/系统正确显示 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 以下变量由插件设置注入（JS 写入 style 属性），此处为兜底默认值 */
    --ai-right: 20px;         /* 距右侧间距（电脑端） */
    --ai-bottom: 365px;       /* 距底部间距（电脑端） */
    --ai-icon-size: 56px;     /* 图标尺寸 */
    --ai-win-right: 84px;     /* 聊天窗口距右侧 */
    --ai-win-bottom: 96px;    /* 聊天窗口距底部 */
}

/* ===== 悬浮入口（AI 图标，由插件自带） ===== */
/* 入口单独固定在视口右下角，且层级高于站点侧边客服条（z-index 9999） */
.ai-assistant-entry {
    position: fixed;
    right: var(--ai-right, 20px);
    bottom: var(--ai-bottom, 365px);
    width: var(--ai-icon-size, 56px);
    height: var(--ai-icon-size, 56px);
    z-index: 10000;
    cursor: pointer;
    animation: aiFloat 2.2s ease-in-out infinite;
}
/* 内置药丸/胶囊形悬浮：宽度按设置，高度按比例自动拉长 */
.ai-assistant-entry.ai-entry-default {
    width: calc(var(--ai-icon-size, 56px) * 0.95);
    height: auto;
    aspect-ratio: 1 / 1.85;
}
.ai-assistant-entry .ai-entry-icon {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 106, 255, .35);
    transition: transform .2s;
}
.ai-assistant-entry:hover .ai-entry-icon {
    transform: scale(1.08);
}
@keyframes aiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 未配置图标时的内置药丸/胶囊形悬浮气泡：蓝白渐变 + 机器人脸 + AI 助理文字 */
.ai-assistant-entry.ai-entry-default {
    border-radius: 999px;
    background: linear-gradient(160deg, #d6e8ff 0%, #b8d4ff 35%, #e6efff 100%);
    color: #1d4ed8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    box-shadow: 0 8px 24px rgba(43, 123, 255, .35), inset 0 1px 0 rgba(255,255,255,.6);
    transition: transform .25s, box-shadow .25s;
    overflow: hidden;
}
.ai-assistant-entry.ai-entry-default:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(43, 123, 255, .45), inset 0 1px 0 rgba(255,255,255,.6);
}
/* 机器人脸（两个眼睛） */
.ai-assistant-entry .ai-entry-face {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    width: 70%;
    height: 30%;
    background: linear-gradient(180deg, #ffffff 0%, #e3edff 100%);
    border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
    box-shadow: 0 2px 6px rgba(43, 123, 255, .18);
    flex-shrink: 0;
}
.ai-assistant-entry .ai-entry-face .ai-eye {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #1f2937;
    border-radius: 50%;
    position: relative;
}
.ai-assistant-entry .ai-entry-face .ai-eye::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
}
/* AI 助理文字 */
.ai-assistant-entry .ai-entry-text {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.05;
    color: #1d4ed8;
    letter-spacing: 1px;
    flex: 1;
    text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
.ai-assistant-entry .ai-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #ff4d4f;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 2;
}
.ai-bubble-icon-open,
.ai-bubble-icon-close {
    display: inline-block;
    line-height: 1;
}
.ai-bubble-icon-close {
    display: none;
}
.ai-assistant-entry.open .ai-bubble-icon-open {
    display: none;
}
.ai-assistant-entry.open .ai-bubble-icon-close {
    display: inline-block;
}

/* ===== 聊天窗口 ===== */
.ai-assistant-window {
    position: absolute;
    right: var(--ai-win-right, 84px);
    bottom: var(--ai-win-bottom, 96px);
    width: 550px;
    max-width: 94vw;
    height: 650px;
    max-height: 86vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
    overflow: hidden;
    display: none;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, .04);
}
.ai-assistant.open .ai-assistant-window {
    display: flex;
}
/* 全屏模式：窗口铺满整个视口 */
.ai-assistant.expanded .ai-assistant-window {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
}
.ai-assistant.expanded .ai-assistant-entry {
    opacity: 0;
    pointer-events: none;
}

/* ===== 窗口头部 ===== */
.ai-assistant-head {
    background: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f2f6;
}
/* 未登录时窗口顶部的固定登录提示条 */
.ai-login-bar {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    line-height: 1.4;
    color: #6b7688;
    background: linear-gradient(90deg, #f4f8ff, #eef4ff);
    border-bottom: 1px solid #e2ebff;
    flex-shrink: 0;
}
.ai-login-bar > i {
    color: #2b7bff;
    font-size: 13px;
}
.ai-login-bar .ai-login-bar-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-login-bar .ai-login-bar-link {
    color: #2b7bff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    padding: 1px 2px;
    transition: color .15s;
}
.ai-login-bar .ai-login-bar-link:hover {
    color: #1a63e0;
}
.ai-head-brand {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.ai-head-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa6ff, #2b7bff);
    margin-right: 8px;
    flex-shrink: 0;
}
.ai-head-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2329;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-head-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.ai-head-actions .ai-head-icon {
    color: #a0a6b2;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}
.ai-head-actions .ai-head-icon:hover {
    background: #f0f2f6;
    color: #2b7bff;
}

/* ===== 内容区（欢迎页 + 聊天） ===== */
.ai-assistant-body {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    position: relative;
}
.ai-assistant-body::-webkit-scrollbar {
    width: 5px;
}
.ai-assistant-body::-webkit-scrollbar-thumb {
    background: #d5d9e0;
    border-radius: 4px;
}

/* 欢迎页（初始） */
.ai-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 8px;
    overflow-y: auto;
}
.ai-welcome-hero {
    text-align: center;
    margin: 8px 0 18px;
    position: relative;
}
.ai-welcome-orb {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d6e8ff 0%, #b3d1ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(43, 123, 255, .2);
    position: relative;
}
.ai-welcome-orb::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa6ff 0%, #2b7bff 100%);
}
.ai-welcome-orb .ai-orb-eye {
    position: absolute;
    top: 50%;
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    transform: translateY(-50%);
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.ai-welcome-orb .ai-orb-eye.left {
    left: 18px;
}
.ai-welcome-orb .ai-orb-eye.right {
    right: 18px;
}
.ai-welcome-h {
    font-size: 20px;
    color: #1f2329;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
}
.ai-welcome-h .ai-highlight {
    color: #2b7bff;
}
.ai-welcome-sub {
    font-size: 12px;
    color: #8a919f;
    margin-top: 2px;
}

/* CTA 按钮组 */
.ai-cta-group {
    display: flex;
    gap: 10px;
    margin: 4px 0 20px;
}
.ai-cta-btn {
    flex: 1;
    padding: 11px 0;
    text-align: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    line-height: 1.3;
}
.ai-cta-btn.ai-cta-primary {
    background: linear-gradient(135deg, #4a8eff 0%, #2b7bff 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(43, 123, 255, .3);
}
.ai-cta-btn.ai-cta-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(43, 123, 255, .4);
}
.ai-cta-btn.ai-cta-ghost {
    background: #fff;
    color: #555;
    border: 1px solid #e0e4eb;
}
.ai-cta-btn.ai-cta-ghost:hover {
    border-color: #2b7bff;
    color: #2b7bff;
}

/* 注册活动提示条（与注册页 {$site.user_register} 同步） */
.ai-reg-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin: 2px 0 14px;
    background: linear-gradient(90deg, #fff8e8, #fff3d6);
    border: 1px solid #ffe2a8;
    border-radius: 10px;
    font-size: 12px;
    color: #8a5a00;
    line-height: 1.55;
    animation: aiMsgIn .35s ease-out;
}
.ai-reg-activity i {
    color: #ff9500;
    font-size: 15px;
    flex-shrink: 0;
}
.ai-reg-activity .ai-reg-activity-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}


/* 知识库卡片 */
.ai-kb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.ai-kb-card {
    background: #f7f9fc;
    border-radius: 10px;
    padding: 12px 12px 10px;
    position: relative;
    border: 1px solid #eef1f5;
}
.ai-kb-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ai-kb-card-tag {
    font-size: 10px;
    color: #2b7bff;
    background: #e8f1ff;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
}
/* “相关咨询”换一换：可点击 + 刷新旋转 */
.ai-kb-card-tag.ai-kb-switch {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    transition: all .18s;
}
.ai-kb-card-tag.ai-kb-switch:hover {
    background: #d9e8ff;
    color: #1a63e0;
}
.ai-kb-card-tag.ai-kb-switch.ai-kb-spinning i {
    animation: aiKbSpin .5s ease;
}
@keyframes aiKbSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ai-kb-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ai-kb-card-list li {
    font-size: 12px;
    color: #4a5568;
    line-height: 1.9;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color .2s;
}
.ai-kb-card-list li::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2b7bff;
    margin-right: 6px;
    flex-shrink: 0;
}
.ai-kb-card-list li:hover {
    color: #2b7bff;
}

/* ===== 消息区（对话） ===== */
.ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 8px;
    background: #f7f9fc;
    display: none;
}
.ai-assistant.chat-mode .ai-welcome {
    display: none;
}
.ai-assistant.chat-mode .ai-chat {
    display: block;
}
.ai-chat::-webkit-scrollbar {
    width: 5px;
}
.ai-chat::-webkit-scrollbar-thumb {
    background: #d5d9e0;
    border-radius: 4px;
}

/* 时间分隔 */
.ai-time-divider {
    text-align: center;
    color: #a0a6b2;
    font-size: 11px;
    margin: 4px 0 14px;
    font-weight: 500;
}

/* 消息行 */
.ai-msg {
    margin-bottom: 14px;
    display: flex;
    animation: aiMsgIn .3s ease-out;
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-msg.ai-msg-bot {
    justify-content: flex-start;
}
.ai-msg.ai-msg-user {
    justify-content: flex-end;
}
.ai-msg .ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa6ff 0%, #2b7bff 100%);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(43, 123, 255, .25);
}
.ai-msg.ai-msg-user .ai-msg-avatar {
    background: linear-gradient(135deg, #a7b0bd 0%, #8a919f 100%);
    margin-right: 0;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
/* 头像为图片时的样式（AI 头像、登录用户头像） */
.ai-msg .ai-msg-avatar.ai-msg-avatar-img {
    background: #fff;
    overflow: hidden;
    padding: 0;
}
.ai-msg .ai-msg-avatar.ai-msg-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.ai-msg .ai-msg-content {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}
.ai-msg .ai-msg-bubble {
    padding: 10px 13px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.75;
    color: #2a2f3a;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    background: #fff;
    border: 1px solid #f0f2f6;
    /* 含 emoji 字体回退，确保 AI 回复中的表情符号能正确显示 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    border-top-left-radius: 4px;
}
.ai-msg.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, #4a8eff 0%, #2b7bff 100%);
    color: #fff;
    border: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(43, 123, 255, .25);
}
/* 回复正文中的链接（自动补全域名并显示页面标题） */
.ai-msg .ai-msg-bubble a {
    color: #2b7bff;
    text-decoration: none;
    border-bottom: 1px solid rgba(43, 123, 255, .4);
    word-break: break-all;
    transition: color .15s, border-color .15s;
}
.ai-msg .ai-msg-bubble a:hover {
    color: #1a63e0;
    border-bottom-color: #1a63e0;
}
.ai-msg.ai-msg-user .ai-msg-bubble a {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, .6);
}
.ai-msg .ai-msg-time {
    font-size: 10px;
    color: #b0b6c0;
    margin-top: 4px;
    padding: 0 2px;
}
.ai-msg.ai-msg-bot .ai-msg-time {
    margin-left: 4px;
}
.ai-msg.ai-msg-user .ai-msg-time {
    text-align: right;
    margin-right: 4px;
}

/* 快捷操作按钮 */
.ai-msg-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.ai-action-btn {
    display: flex;
    align-items: center;
    padding: 10px 13px;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 8px;
    font-size: 13px;
    color: #2a2f3a;
    cursor: pointer;
    text-align: left;
    transition: all .2s;
    line-height: 1.4;
}
.ai-action-btn:hover {
    border-color: #2b7bff;
    background: #f5f9ff;
    color: #2b7bff;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(43, 123, 255, .12);
}
.ai-action-btn i {
    width: 20px;
    color: #2b7bff;
    margin-right: 10px;
    font-size: 14px;
    flex-shrink: 0;
}
.ai-action-btn .ai-action-arrow {
    margin-left: auto;
    color: #c0c6cf;
    font-size: 12px;
    transition: color .2s;
}
.ai-action-btn:hover .ai-action-arrow {
    color: #2b7bff;
}

/* ===== 输入区 ===== */
.ai-assistant-input {
    padding: 12px 14px;
    background: #fff;
    flex-shrink: 0;
}
.ai-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f7f9fc;
    border: 1.5px solid #d6e4ff;
    border-radius: 10px;
    padding: 4px 4px 4px 12px;
    transition: all .2s;
}
.ai-input-row:focus-within {
    border-color: #2b7bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(43, 123, 255, .08);
}
.ai-assistant-input input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    outline: none;
    color: #2a2f3a;
    padding: 9px 0;
    min-width: 0;
}
.ai-assistant-input input::placeholder {
    color: #a0a6b2;
}
.ai-assistant-input .ai-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    color: #c0c6cf;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ai-input-row:focus-within .ai-send-btn {
    color: #2b7bff;
}
.ai-assistant-input .ai-send-btn:hover {
    background: #e8f1ff;
    color: #2b7bff;
}

/* 页脚声明 */
.ai-footer-note {
    text-align: center;
    font-size: 11px;
    color: #a0a6b2;
    padding: 4px 0 12px;
    background: #fff;
    border-top: 1px solid #f0f2f6;
}
.ai-footer-note a {
    color: #2b7bff;
    text-decoration: none;
}
.ai-footer-note a:hover {
    text-decoration: underline;
}

/* 正在思考 */
.ai-thinking {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
.ai-thinking .ai-thinking-text {
    font-size: 12px;
    color: #8a919f;
}
.ai-thinking .ai-thinking-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ai-thinking .ai-thinking-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2b7bff;
    animation: aiBlink 1.2s infinite;
}
.ai-thinking .ai-thinking-dots i:nth-child(2) {
    animation-delay: .2s;
}
.ai-thinking .ai-thinking-dots i:nth-child(3) {
    animation-delay: .4s;
}
@keyframes aiBlink {
    0%, 80%, 100% { opacity: .3; transform: scale(.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* 移动端（手机端间距同样可在插件设置中调整） */
@media (max-width: 480px) {
    .ai-assistant,
    .ai-assistant-entry {
        --ai-right: var(--ai-m-right, 14px) !important;
        --ai-bottom: var(--ai-m-bottom, 200px) !important;
        --ai-icon-size: var(--ai-m-size, 48px) !important;
    }
    .ai-assistant {
        --ai-win-right: 10px;
        --ai-win-bottom: 76px;
    }
    .ai-assistant-window {
        width: calc(100vw - 20px);
        height: 78vh;
        border-radius: 14px;
    }
    .ai-assistant.expanded .ai-assistant-window {
        width: 100vw;
        height: 100vh;
    }
}

/* ===== 历史会话面板 ===== */
.ai-history-mask {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(20, 24, 33, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.ai-history-panel {
    width: 340px;
    max-width: 92vw;
    max-height: 80vh;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.ai-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2329;
    border-bottom: 1px solid #f0f2f6;
}
.ai-history-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: #8a919f;
    padding: 0 4px;
}
.ai-history-close:hover {
    color: #1f2329;
}
.ai-history-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 10px;
}
.ai-history-empty {
    text-align: center;
    color: #8a919f;
    font-size: 13px;
    padding: 40px 0;
}
.ai-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ai-history-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
.ai-history-list li:hover {
    background: #f2f6ff;
}
.ai-history-q {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-history-time {
    font-size: 11px;
    color: #a0a6b1;
    flex-shrink: 0;
}
.ai-history-ops {
    padding: 10px;
    border-top: 1px solid #f0f2f6;
    text-align: right;
}
.ai-history-clear {
    border: 1px solid #e1e6ef;
    background: #fff;
    color: #e0563b;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.ai-history-clear:hover {
    background: #fff1ee;
    border-color: #f2b8aa;
}
