/* ============================================================
   ai-chat.css —— 「AI 对话」全屏聊天页 + AI 配置卡片删除图标
   与 style.css 的「深夜案卷」视觉一致（深墨蓝 + 黄铜强调）
   ============================================================ */

/* ---------- AI 配置卡片：「下架 / 编辑 / 聊天」一行右对齐；删除按钮在其上方、同样右对齐 ---------- */
/* 【需求3】删除图标放在操作行右上方（右上角）并与右侧对齐，不改动下方按钮行位置。 */
#ai-config-list .ai-card-actions {
    display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
}
#ai-config-list .ai-card-actions-row { display: flex; align-items: center; gap: 6px; }
.ai-card-del {
    width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
    border: 1px solid transparent; background: transparent;
    color: #d94545; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; transition: all .18s var(--ease);
}
.ai-card-del:hover { background: rgba(217,69,69,0.14); border-color: rgba(217,69,69,0.5); }
.ai-card-del.is-disabled { color: #5b6072; cursor: not-allowed; }
.ai-mini-btn-chat { color: var(--brass-bright); border-color: rgba(201,151,75,0.45); }
.ai-mini-btn-chat:hover { background: rgba(201,151,75,0.14); }

/* ---------- 全屏模式 ---------- */
.app-container.ai-chat-mode .app-header { display: none; }
.app-container.ai-chat-mode .bottom-nav { display: none; }
/* 【需求4】手机端地址栏会占掉一部分高度：用 100dvh 保证底部输入区（含功能按钮）始终在可视范围内 */
.app-container.ai-chat-mode { height: 100vh; height: 100dvh; }
.app-container.ai-chat-mode .page-content { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.app-container.ai-chat-mode #page-ai-chat.active {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
}
.app-container.ai-chat-mode #page-ai-chat.page-anim-forward,
.app-container.ai-chat-mode #page-ai-chat.page-anim-back { animation: none; }

.ai-chat-shell {
    position: relative; display: flex; flex-direction: column;
    height: 100%; min-height: 0; width: 100%;
    background: var(--bg); overflow: hidden;
}

/* ---------- 顶栏 ---------- */
.ai-chat-topbar {
    position: relative;
    flex-shrink: 0; display: flex; align-items: center; gap: 2px;
    padding: 6px 10px;
    background: linear-gradient(180deg, var(--surface), var(--bg));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 16px rgba(0,0,0,0.22);
    z-index: 5;
}
/* 【需求1】返回按钮单独在最左；「对话历史」+ AI 头像/文字为一组，整体向右收紧（间距更紧凑、位置更靠右） */
.ai-chat-topleft {
    display: flex; align-items: center; gap: 2px;
    flex: 0 1 auto; min-width: 0; overflow: hidden;
    margin-left: 8px;
}
/* 【需求1】会话标题：由「右侧按钮下方」改为放在「角色设定」按钮左侧，字号 9.5px → 13px（放大） */
.ai-chat-title {
    min-width: 0; max-width: 44vw; margin-left: auto; text-align: right;
    font-size: 13px; font-weight: 600;
    line-height: 1.3; color: var(--ink-text-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding: 0 6px; pointer-events: none;
}
.ai-chat-topright-btns { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ai-chat-icon-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 10px; border: 1px solid transparent;
    background: transparent; color: var(--ink-text-soft);
    cursor: pointer; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s var(--ease);
}
.ai-chat-icon-btn:hover { background: var(--surface-hover); border-color: var(--border); color: var(--brass-bright); }
.ai-chat-ai-btn {
    display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%;
    background: transparent; border: 1px solid transparent; border-radius: 12px;
    padding: 3px 5px; cursor: pointer; color: inherit; text-align: left;
}
.ai-chat-ai-btn:hover { background: var(--surface-hover); border-color: var(--border); }
/* 【需求3】头像在名称左侧 */
.ai-chat-ai-texts { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ai-chat-ai-name {
    font-size: 13px; font-weight: 600; color: var(--ink-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ai-chat-ai-model {
    font-size: 10px; line-height: 1.2; color: var(--ink-text-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ai-chat-ai-avatar {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 1px solid var(--border); flex-shrink: 0;
}
.ai-chat-key-warn {
    font-size: 10px; color: #e2888a; border: 1px solid rgba(217,69,69,0.5);
    border-radius: 8px; padding: 1px 5px; flex-shrink: 0;
}

/* ---------- 【需求2】新建对话：旧文字 0.15s 渐隐 → 新文字 0.15s 浮现 ---------- */
.ai-chat-fading, .ai-chat-fadein { pointer-events: none; }
.ai-chat-fading { animation: aiChatFadeOut .15s var(--ease) forwards; }
.ai-chat-fadein { animation: aiChatFadeIn .15s var(--ease); }
@keyframes aiChatFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes aiChatFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 消息区 ---------- */
.ai-chat-body {
    flex: 1 1 0; min-height: 0; overflow-y: auto;
    padding: 14px 12px 8px;
    display: flex; flex-direction: column; gap: 16px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.ai-chat-empty { margin: auto; text-align: center; color: var(--ink-text-mute); padding: 20px 28px; }
.ai-chat-empty-greet { font-size: 18px; line-height: 1.7; color: var(--ink-text-soft); font-weight: 600; }

.ai-msg { display: flex; flex-direction: column; width: 100%; }
.ai-msg.is-user { align-items: flex-end; }
.ai-msg.is-ai { align-items: flex-start; }
.ai-msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; padding: 0 6px; }
.ai-msg.is-user .ai-msg-head { justify-content: flex-end; }
.ai-msg.is-ai .ai-msg-name { order: 2; }
.ai-msg.is-ai .ai-msg-avatar { order: 1; }
.ai-msg-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ai-msg-name { font-size: 12px; color: var(--ink-text-mute); }
.ai-msg-bubble {
    width: 96%; max-width: 96%;
    border-radius: 14px; padding: 10px 14px;
    font-size: 15px; line-height: 1.75;
    word-break: break-word; overflow-wrap: anywhere;
}
.ai-msg.is-ai .ai-msg-bubble { background: var(--surface-raised); border: 1px solid var(--border); }
.ai-msg.is-user .ai-msg-bubble {
    background: linear-gradient(135deg, rgba(201,151,75,0.22), rgba(201,151,75,0.09));
    border: 1px solid rgba(201,151,75,0.35);
    cursor: text;
}
.ai-msg.is-user .ai-msg-bubble:active { filter: brightness(1.08); }
.ai-msg-content.streaming::after {
    content: ''; display: inline-block; width: 7px; height: 15px;
    background: var(--brass-bright); margin-left: 3px; vertical-align: -2px;
    animation: aiChatCaret 1s steps(2) infinite;
}
@keyframes aiChatCaret { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

.ai-msg-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ai-msg-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ink-text-mute);
    animation: aiChatBlink 1.2s infinite;
}
.ai-msg-typing span:nth-child(2) { animation-delay: .2s; }
.ai-msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiChatBlink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

.ai-msg-error { margin-top: 8px; font-size: 12.5px; color: #e2888a; }
.ai-msg-stopped { margin-top: 6px; font-size: 12px; color: var(--ink-text-mute); }
.ai-msg-searchcount { margin-top: 8px; font-size: 12px; color: var(--ink-text-mute); }

/* ---------- 版本切换 < n/n > ---------- */
.ai-msg-versions {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 4px; padding: 0 6px;
    font-size: 12px; color: var(--ink-text-mute);
}
.ai-msg-versions button {
    width: 24px; height: 24px; border-radius: 7px;
    border: 1px solid var(--border); background: var(--surface-raised);
    color: var(--ink-text-soft); cursor: pointer; font-size: 14px; line-height: 1;
}
.ai-msg-versions button:disabled { opacity: .35; cursor: default; }
.ai-msg-versions span { min-width: 30px; text-align: center; }

/* ---------- 思考气泡（独立气泡，流式显示；完成后自动折叠并显示用时） ---------- */
.ai-msg-think {
    width: 96%; max-width: 96%; margin-bottom: 8px; box-sizing: border-box;
    border-radius: 14px; border: 1px dashed rgba(201,151,75,0.45);
    background: rgba(201,151,75,0.07);
    padding: 8px 12px;
}
.ai-msg-think-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: none; color: var(--ink-text-mute);
    font-size: 12.5px; cursor: pointer; padding: 0;
}
.ai-msg-think-toggle:hover { color: var(--brass-bright); }
.ai-msg-think-toggle .fa-chevron-down { transition: transform .18s var(--ease); }
.ai-msg-think.is-open .ai-msg-think-toggle .fa-chevron-down { transform: rotate(180deg); }
.ai-msg-think.is-streaming .ai-msg-think-toggle { color: var(--brass-bright); }
.ai-msg-think-body {
    margin-top: 8px; padding: 6px 0 0; border-top: 1px solid rgba(201,151,75,0.2);
    font-size: 12.5px; color: var(--ink-text-mute); line-height: 1.7;
    max-height: 320px; overflow-y: auto;
    white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}

/* ---------- AI 气泡下方操作（重新生成 / 复制，仅矢量图标） ---------- */
.ai-msg-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding: 0 6px; }
.ai-msg-actions button {
    width: 28px; height: 28px; border-radius: 8px;
    border: 1px solid transparent; background: transparent;
    color: var(--ink-text-mute); cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s var(--ease);
}
.ai-msg-actions button:hover { background: var(--surface-hover); border-color: var(--border); color: var(--brass-bright); }
.ai-msg-actions button.is-ok { color: #2e9e5b; }

/* ---------- 回复尾部统计（输出速度 / 上下文用量，与「重新生成 / 复制」同一行，位于复制右侧） ---------- */
.ai-msg-stats {
    display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
    margin: 0 0 0 10px; padding: 0; cursor: help;
    font-size: 12px; line-height: 1; letter-spacing: .2px;
    color: var(--ink-text-mute); user-select: none;
}
.ai-msg-stats .ai-stat { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ai-msg-stats svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .78; }
.ai-msg-stats .ai-stat-dim { opacity: .72; }

/* ---------- 联网搜索结果 ---------- */
/* ---------- 联网搜索：站点图标轮播 + 条数（点条数展开明细） ---------- */
.ai-searches { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-search-block {
    border: 1px solid var(--border); border-radius: 10px;
    background: rgba(255,255,255,0.025); padding: 6px 10px;
}
.ai-search-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }

/* 三枚图标：中（大）/ 左 / 右（小、浅、轻微 3D 侧转） */
.ai-spots { position: relative; width: 104px; height: 40px; flex: 0 0 auto; perspective: 260px; }
.ai-spot {
    position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.06);
    transition: transform .38s cubic-bezier(.4,0,.2,1), opacity .38s, filter .38s;
    will-change: transform, opacity;
    transform-origin: 50% 50%;
}
.ai-spot.is-c { transform: translateX(0) scale(1); opacity: 1; z-index: 3; }
.ai-spot.is-l { transform: translateX(-31px) scale(.74) rotateY(22deg); opacity: .42; filter: saturate(.55); z-index: 2; }
.ai-spot.is-r { transform: translateX(31px) scale(.74) rotateY(-22deg); opacity: .42; filter: saturate(.55); z-index: 2; }
.ai-spot.is-out { transform: translateX(-46px) scale(.55) rotateY(30deg); opacity: 0; z-index: 1; }
/* 回收位：关掉过渡，让节点“无动画”跳到右侧，再淡入 */
.ai-spot.is-ghost { transition: none !important; opacity: 0; }

.ai-spot-letter, .ai-spot-img { position: absolute; inset: 0; border-radius: 50%; }
.ai-spot-letter {
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 600; color: rgba(255,255,255,.92);
    background: hsl(var(--h, 210) 30% 40%);
}
.ai-spot-img { width: 100%; height: 100%; object-fit: cover; }

.ai-search-count {
    display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
    border: 1px solid transparent; background: transparent; cursor: pointer;
    color: var(--ink-text-mute); font-size: 12px; padding: 5px 7px; border-radius: 8px;
    transition: all .18s var(--ease);
}
.ai-search-count:hover { background: var(--surface-hover); border-color: var(--border); color: var(--brass-bright); }
.ai-search-count i { font-size: 10px; transition: transform .2s; }
.ai-search-count[aria-expanded="true"] i { transform: rotate(180deg); }

.ai-search-detail { margin-top: 6px; }
.ai-search-fail { font-size: 12px; color: #e2888a; display: inline-flex; align-items: center; gap: 5px; }
.ai-search-q { font-size: 12.5px; color: var(--brass-bright); margin-bottom: 6px; }
.ai-search-err { color: #e2888a; }
.ai-search-results { display: flex; flex-direction: column; gap: 6px; }
.ai-search-item {
    display: block; text-decoration: none; padding: 5px 7px;
    border-radius: 7px; background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
}
.ai-search-item:hover { border-color: var(--border); }
.ai-search-title { display: block; font-size: 12.5px; color: var(--ink-text-soft); }
.ai-search-url {
    display: block; font-size: 10.5px; color: #6b7085; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Markdown 内容 ---------- */
.ai-md p { margin: 0 0 8px; }
.ai-md > *:last-child { margin-bottom: 0; }
.ai-md h1, .ai-md h2, .ai-md h3, .ai-md h4, .ai-md h5, .ai-md h6 {
    font-family: var(--font-display); font-weight: 700; color: var(--ink-text);
    margin: 12px 0 6px; line-height: 1.35;
}
.ai-md h1 { font-size: 1.55em; }
.ai-md h2 { font-size: 1.32em; }
.ai-md h3 { font-size: 1.16em; }
.ai-md h4, .ai-md h5, .ai-md h6 { font-size: 1.03em; }
.ai-md ul, .ai-md ol { margin: 6px 0 10px; padding-left: 22px; }
.ai-md li { margin: 3px 0; }
.ai-md a { color: var(--brass-bright); text-decoration: underline; text-underline-offset: 2px; }
.ai-md strong { color: #fff; font-weight: 700; }
.ai-md del { color: var(--ink-text-mute); }
.ai-md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.ai-md blockquote {
    margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--brass-dim);
    background: rgba(255,255,255,0.03); color: var(--ink-text-soft);
    border-radius: 0 8px 8px 0;
}
.ai-md code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
    background: rgba(0,0,0,0.4); border-radius: 5px; padding: 1px 5px; font-size: .89em;
    color: #e7c58a;
}
.ai-pre {
    background: #0c0f16; border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 12px; margin: 8px 0; overflow-x: auto;
}
.ai-pre code { background: transparent; padding: 0; color: #cfd6e6; font-size: 12.5px; line-height: 1.65; white-space: pre; }
.ai-table-wrap { overflow-x: auto; margin: 8px 0; -webkit-overflow-scrolling: touch; }
.ai-table { border-collapse: collapse; min-width: 100%; font-size: 13.5px; }
.ai-table th, .ai-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
.ai-table th { background: rgba(201,151,75,0.12); color: var(--ink-text); font-weight: 600; }
.ai-math { color: #e7c58a; }
.ai-math-block { display: block; text-align: center; padding: 6px 0; overflow-x: auto; }
.ai-md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; margin: 8px 0; }
.ai-md .katex { font-size: 1.02em; }

/* ---------- 附件 ---------- */
.ai-atts { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-msg-bubble .ai-atts { margin-bottom: 8px; }
.ai-att {
    position: relative; display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--border); border-radius: 10px;
    padding: 5px 8px 5px 6px; background: var(--surface-raised);
    max-width: 170px;
}
.ai-atts.is-pending .ai-att { padding-right: 20px; }
.ai-att-thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.ai-att-icon {
    width: 34px; height: 34px; border-radius: 7px; flex-shrink: 0;
    background: rgba(201,151,75,0.15); color: var(--brass-bright);
    display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.ai-att-name {
    font-size: 12px; color: var(--ink-text-soft); max-width: 110px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-att-del {
    position: absolute; top: -6px; right: -6px;
    width: 18px; height: 18px; border-radius: 50%; border: none;
    background: #d94545; color: #fff; font-size: 10px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- 输入区 ---------- */
.ai-chat-inputwrap {
    flex-shrink: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: linear-gradient(0deg, var(--surface), rgba(26,31,44,0.6));
}
.ai-chat-attachments { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
/* 【需求1】整块输入框：上方为占满整行的文本域，下方一行左侧工具按钮、右侧发送按钮 */
.ai-chat-inputbox {
    position: relative;
    display: flex; flex-direction: column;
    border: 1px solid var(--border); border-radius: 16px;
    background: var(--surface-raised);
    padding: 5px 8px 4px;
    transition: border-color .18s var(--ease);
}
.ai-chat-inputbox:focus-within { border-color: var(--brass-dim); }
.ai-chat-inputbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 0; }
.ai-chat-tools { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.ai-chat-tool-btn {
    min-width: 34px; height: 34px; padding: 0 8px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-raised); color: var(--ink-text-soft);
    cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    transition: all .18s var(--ease);
}
.ai-chat-tool-btn:hover { border-color: var(--brass-dim); color: var(--brass-bright); }
.ai-chat-tool-btn span { font-size: 11px; }
.ai-chat-tool-btn.is-on {
    color: var(--brass-bright); border-color: var(--brass);
    background: rgba(201,151,75,0.16);
    box-shadow: 0 0 10px rgba(201,151,75,0.25);
}
#ai-chat-input {
    width: 100%; box-sizing: border-box; min-height: 40px; max-height: 180px;
    resize: none; border: none; border-radius: 0;
    background: transparent; color: var(--ink-text);
    padding: 2px 6px; font-size: 15px; line-height: 1.5; font-family: inherit;
    outline: none;
}
#ai-chat-input:focus { border-color: var(--brass-dim); }
.ai-chat-send {
    width: 38px; height: 38px; border-radius: 50%; border: none; flex-shrink: 0;
    background: var(--brass); color: #16191f; cursor: pointer; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s var(--ease);
}
.ai-chat-send:hover { background: var(--brass-bright); }
.ai-chat-send.is-stop { background: #d94545; color: #fff; }
.ai-chat-send.is-stop:hover { background: #e05a5a; }

/* ---------- 【需求2】「+」上传面板：点击 + 后在输入框下方展开，输入框随之上移 ---------- */
.ai-chat-plus-panel {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: 8px; padding: 10px 2px 2px;
    border-top: 1px dashed var(--border);
    animation: aiChatPlusPanelIn .18s var(--ease);
    max-height: 56vh; overflow-y: auto;
}
.ai-chat-plus-panel[hidden] { display: none; }
@keyframes aiChatPlusPanelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.ai-chat-plus-opt {
    flex: 1 1 0; min-width: 0; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 8px; border-radius: 14px;
    border: 1px solid var(--border); background: var(--surface-raised);
    color: var(--ink-text-soft); font-size: 12.5px;
    transition: all .18s var(--ease);
}
.ai-chat-plus-opt:hover, .ai-chat-plus-opt:active { border-color: var(--brass-dim); color: var(--brass-bright); }
.ai-chat-plus-opt-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; color: var(--brass-bright);
    background: rgba(201,151,75,0.14); border: 1px solid rgba(201,151,75,0.30);
}
.ai-chat-plus-opt:hover .ai-chat-plus-opt-icon { background: rgba(201,151,75,0.24); }

/* ---------- 「+」面板：四宫格（拍照 / 照片 / 草图 / 上传文件） ---------- */
.ai-plus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ai-plus-tile {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 10px 4px 9px; border-radius: 14px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface-raised);
    color: var(--ink-text-soft); font-size: 12px;
    transition: all .18s var(--ease);
}
.ai-plus-tile:active { transform: scale(.97); }
.ai-plus-tile:hover { border-color: var(--brass-dim); color: var(--brass-bright); }
.ai-plus-tile-ic {
    width: 42px; height: 42px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--brass-bright);
    background: rgba(201,151,75,0.13); border: 1px solid rgba(201,151,75,0.26);
}
.ai-plus-tile-tx { line-height: 1; }

/* ---------- 「+」面板：列表行 ---------- */
.ai-plus-list {
    display: flex; flex-direction: column; border-radius: 14px;
    overflow: hidden; border: 1px solid var(--border);
}
.ai-plus-row {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; background: var(--surface-raised); border: 0; cursor: pointer;
    color: var(--ink-text-soft); text-align: left;
    border-bottom: 1px solid var(--border);
    transition: background .16s var(--ease);
}
.ai-plus-row:last-child { border-bottom: 0; }
.ai-plus-row:hover:not(.is-disabled) { background: var(--surface-hover); }
.ai-plus-row.is-disabled { opacity: .45; cursor: not-allowed; }
.ai-plus-row-ic {
    width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--brass-bright); background: rgba(201,151,75,0.10);
}
.ai-plus-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-plus-row-t { font-size: 13.5px; color: var(--ink-text); line-height: 1.2; }
.ai-plus-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2px; }
.ai-plus-row-s {
    font-size: 11.5px; color: var(--ink-text-mute); line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-plus-row-chev { font-size: 11px; color: var(--ink-text-mute); flex: 0 0 auto; }

/* 开关 */
.ai-switch {
    width: 40px; height: 24px; flex: 0 0 auto; border-radius: 999px; position: relative;
    background: rgba(255,255,255,.14); border: 1px solid var(--border);
    transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ai-switch-knob {
    position: absolute; top: 50%; left: 3px; width: 18px; height: 18px; margin-top: -9px;
    border-radius: 50%; background: #cdd3e0; transition: transform .2s var(--ease), background .2s;
}
.ai-switch.is-on { background: rgba(201,151,75,.55); border-color: var(--brass-dim); }
.ai-switch.is-on .ai-switch-knob { transform: translateX(16px); background: #fff8ea; }

/* 上下文用量环 */
.ai-plus-ring {
    width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
    background: conic-gradient(var(--brass-bright) calc(var(--p, 0) * 1%), rgba(255,255,255,.13) 0);
    -webkit-mask: radial-gradient(circle 7px, transparent 98%, #000 100%);
    mask: radial-gradient(circle 7px, transparent 98%, #000 100%);
}

/* ---------- 简易弹层（草图 / 工作区文件） ---------- */
.ai-simple-mask {
    position: fixed; inset: 0; z-index: 1900; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.ai-simple-card {
    width: 100%; max-width: 520px; max-height: 82vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.ai-simple-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    font-size: 14px; color: var(--ink-text);
}
.ai-simple-x {
    width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer;
    background: transparent; color: var(--ink-text-mute);
}
.ai-simple-x:hover { background: var(--surface-hover); color: var(--brass-bright); }
.ai-simple-body { padding: 12px 14px; overflow-y: auto; }
.ai-simple-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--border); }

/* 草图 */
#ai-sketch-canvas {
    display: block; width: 100%; height: auto;
    background: #fbf7ee; border-radius: 10px; border: 1px solid var(--border);
    touch-action: none; cursor: crosshair;
}
.ai-sketch-tools { display: flex; align-items: center; gap: 10px; padding: 10px 0 0; }
.ai-sketch-tools input[type="color"] {
    width: 34px; height: 28px; padding: 0; border: 1px solid var(--border);
    border-radius: 8px; background: transparent;
}
.ai-sketch-tools input[type="range"] { flex: 1 1 auto; }
.ai-sketch-tools .btn-back, .ai-sketch-tools .btn-primary { padding: 6px 12px; font-size: 12.5px; }

/* 工作区文件列表 */
.ai-ws-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.ai-ws-item:last-child { border-bottom: 0; }
.ai-ws-name {
    flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink-text-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-ws-size { flex: 0 0 auto; font-size: 11.5px; color: var(--ink-text-mute); }
.ai-ws-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.ai-ws-actions a, .ai-ws-actions button {
    width: 28px; height: 28px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: transparent;
    color: var(--ink-text-mute); cursor: pointer; font-size: 12px;
}
.ai-ws-actions a:hover, .ai-ws-actions button:hover { color: var(--brass-bright); border-color: var(--brass-dim); }
.ai-ws-empty { padding: 18px 0; text-align: center; color: var(--ink-text-mute); font-size: 12.5px; }
.ai-search-empty { font-size: 12px; color: var(--ink-text-mute); }

/* ---------- 思考程度弹出层（浮在输入框上方） ---------- */
.ai-chat-think-pop {
    position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 22;
    background: var(--surface-raised); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.45);
    display: none;
}
.ai-chat-think-pop.open { display: block; }
.ai-chat-think-hint { font-size: 12px; color: #e0a94b; line-height: 1.55; margin-bottom: 12px; }
#ai-chat-think-range { width: 100%; accent-color: var(--brass); }
.ai-chat-think-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-text-mute); margin-top: 2px; }
.ai-chat-think-cur { text-align: center; margin-top: 10px; font-size: 12px; color: var(--ink-text-soft); }
.ai-chat-think-cur b { color: var(--brass-bright); }

/* ---------- 【需求4】思考强度样式：超高换色 / 极高动态特效（能量脉冲，非流光） ---------- */
/* 超高：调节条整体切换为炽红能量色 */
.ai-chat-think-pop.lvl-veryhigh {
    border-color: rgba(255,107,74,0.55);
    background: linear-gradient(180deg, rgba(255,107,74,0.08), var(--surface-raised) 42%);
    box-shadow: 0 14px 34px rgba(0,0,0,0.45), 0 0 18px rgba(255,107,74,0.18);
}
.ai-chat-think-pop.lvl-veryhigh #ai-chat-think-range { accent-color: #ff6b4a; }
.ai-chat-think-pop.lvl-veryhigh .ai-chat-think-hint { color: #ff8a6b; }
.ai-chat-think-pop.lvl-veryhigh .ai-chat-think-cur b { color: #ff6b4a; }
.ai-chat-think-pop.lvl-veryhigh .ai-chat-think-scale span:nth-last-child(-n+2) { color: #ff8a6b; font-weight: 600; }
/* 思考按钮同步换色 */
.ai-chat-tool-btn.lvl-veryhigh {
    color: #ff6b4a; border-color: rgba(255,107,74,0.55);
    background: rgba(255,107,74,0.12);
}
.ai-chat-tool-btn.lvl-veryhigh:hover { color: #ff8a6b; border-color: rgba(255,107,74,0.8); }

/* 极高：在超高基础上叠加「能量脉冲 + 粒子升腾」动态特效（不用流光） */
.ai-chat-think-pop.lvl-extreme {
    border-color: rgba(255,80,60,0.8);
    background:
        radial-gradient(circle at 20% 85%, rgba(255,120,80,0.16) 0, transparent 34%),
        radial-gradient(circle at 78% 18%, rgba(255,90,60,0.14) 0, transparent 30%),
        linear-gradient(180deg, rgba(255,90,60,0.14), var(--surface-raised) 46%);
    box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 22px rgba(255,90,60,0.35);
    animation: aiThinkExtremeBreath 1.6s ease-in-out infinite;
    overflow: hidden;
}
/* 能量脉冲光环：从中心向外扩散的环形波纹 */
.ai-chat-think-pop.lvl-extreme::before {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 60px; height: 60px; margin: -30px 0 0 -30px;
    border-radius: 50%;
    border: 2px solid rgba(255,120,80,0.55);
    pointer-events: none;
    animation: aiThinkPulseRing 1.6s ease-out infinite;
}
/* 粒子升腾：背景里的小光点缓慢向上漂移 + 明暗呼吸 */
.ai-chat-think-pop.lvl-extreme::after {
    content: ''; position: absolute; inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,150,110,0.9) 1px, transparent 1.6px),
        radial-gradient(circle, rgba(255,120,90,0.7) 1px, transparent 1.6px),
        radial-gradient(circle, rgba(255,170,130,0.8) 1px, transparent 1.6px);
    background-size: 74px 74px, 97px 97px, 130px 130px;
    background-position: 0 0, 12px 30px, 40px 8px;
    animation: aiThinkParticles 3.2s linear infinite;
    opacity: .5;
}
@keyframes aiThinkExtremeBreath {
    0%, 100% { box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 18px rgba(255,90,60,0.28); }
    50%      { box-shadow: 0 14px 34px rgba(0,0,0,0.5), 0 0 34px rgba(255,90,60,0.55); }
}
@keyframes aiThinkPulseRing {
    0%   { transform: scale(.35); opacity: .9; }
    100% { transform: scale(2.6); opacity: 0; }
}
@keyframes aiThinkParticles {
    0%   { background-position: 0 74px, 12px 104px, 40px 82px; opacity: .35; }
    50%  { opacity: .75; }
    100% { background-position: 0 0, 12px 30px, 40px 8px; opacity: .35; }
}
.ai-chat-think-pop.lvl-extreme #ai-chat-think-range { accent-color: #ff503c; }
.ai-chat-think-pop.lvl-extreme .ai-chat-think-hint { color: #ff9a7a; }
.ai-chat-think-pop.lvl-extreme .ai-chat-think-cur b { color: #ff503c; }
.ai-chat-think-pop.lvl-extreme .ai-chat-think-scale span:nth-last-child(-n+2) { color: #ff9a7a; font-weight: 700; }
/* 极高时思考按钮：炽红 + 呼吸辉光 */
.ai-chat-tool-btn.lvl-extreme {
    color: #ff503c; border-color: rgba(255,80,60,0.75);
    background: rgba(255,80,60,0.16);
    animation: aiThinkBtnBreath 1.6s ease-in-out infinite;
}
.ai-chat-tool-btn.lvl-extreme:hover { color: #ffb09a; }
@keyframes aiThinkBtnBreath {
    0%, 100% { box-shadow: 0 0 6px rgba(255,80,60,0.25); }
    50%      { box-shadow: 0 0 16px rgba(255,80,60,0.6); }
}

/* ---------- 历史抽屉 ---------- */
.ai-chat-drawer-mask {
    position: absolute; inset: 0; z-index: 30;
    background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
    transition: opacity .22s var(--ease);
}
.ai-chat-drawer-mask.show { opacity: 1; pointer-events: auto; }
.ai-chat-drawer {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 31;
    width: min(86vw, 350px);
    background: var(--surface); border-right: 1px solid var(--border);
    transform: translateX(-104%); transition: transform .26s var(--ease);
    display: flex; flex-direction: column;
    box-shadow: 6px 0 26px rgba(0,0,0,0.4);
}
.ai-chat-drawer.open { transform: translateX(0); }
.ai-chat-drawer-head {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 12px 12px; border-bottom: 1px solid var(--border);
    font-size: 14px; color: var(--ink-text); font-weight: 600;
}
.ai-chat-drawer-head-btns { display: flex; align-items: center; gap: 6px; }
.ai-chat-drawer-new {
    border: 1px solid rgba(201,151,75,0.45); background: rgba(201,151,75,0.12);
    color: var(--brass-bright); border-radius: 9px; padding: 6px 10px;
    font-size: 12px; cursor: pointer;
}
.ai-chat-drawer-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; }
.ai-drawer-empty { text-align: center; color: var(--ink-text-mute); font-size: 13px; padding: 24px 12px; }
.ai-drawer-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent;
}
.ai-drawer-item:hover { background: var(--surface-hover); }
.ai-drawer-item.active { border-color: rgba(201,151,75,0.5); background: rgba(201,151,75,0.10); }
.ai-drawer-main { flex: 1 1 auto; min-width: 0; }
.ai-drawer-title { font-size: 13.5px; color: var(--ink-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-drawer-meta { font-size: 11px; color: var(--ink-text-mute); margin-top: 3px; }
.ai-drawer-del {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    border: 1px solid transparent; background: transparent; color: #b96a6a;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.ai-drawer-del:hover { background: rgba(217,69,69,0.14); border-color: rgba(217,69,69,0.4); color: #d94545; }

/* ---------- 切换 AI 列表 ---------- */
.ai-switch-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); margin-bottom: 8px;
}
.ai-switch-item:hover { background: var(--surface-hover); }
.ai-switch-item.active { border-color: rgba(201,151,75,0.6); background: rgba(201,151,75,0.10); }
.ai-switch-item.not-ready { opacity: .72; }
.ai-switch-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ai-switch-main { flex: 1 1 auto; min-width: 0; }
.ai-switch-name { font-size: 14px; color: var(--ink-text); }
.ai-switch-model { font-size: 11.5px; color: var(--ink-text-mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 角色预设 / 搜索设置 ---------- */
.ai-role-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-role-preset {
    border: 1px solid var(--border); background: var(--surface-raised);
    color: var(--ink-text-soft); border-radius: 9px; padding: 6px 14px;
    font-size: 13px; cursor: pointer;
}
.ai-role-preset.active { border-color: var(--brass); color: var(--brass-bright); background: rgba(201,151,75,0.14); }
#ai-chat-role-prompt, #ai-chat-edit-text {
    width: 100%; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-raised); color: var(--ink-text);
    padding: 10px; font-size: 14px; line-height: 1.6; font-family: inherit; resize: vertical;
}
.ai-search-opt {
    border: 1px solid var(--border); border-radius: 10px;
    padding: 10px; margin-bottom: 10px;
}
.ai-search-opt .radio-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.ai-search-opt input[type="text"] {
    width: 100%; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface-raised); color: var(--ink-text); padding: 8px 10px; font-size: 13px;
}
.ai-search-opt input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brass); }

/* ---------- 小屏适配 ---------- */
@media (max-width: 560px) {
    .ai-chat-title { max-width: 30vw; font-size: 12.5px; }
    .ai-chat-topleft { margin-left: 4px; }
    .ai-msg-bubble, .ai-msg-think { width: 98%; max-width: 98%; }
    .ai-msg-bubble { font-size: 14.5px; }
    .ai-chat-tool-btn { padding: 0 7px; }
    .ai-chat-plus-opt { padding: 10px 6px; }
}

/* 【AI 额度】输入栏右侧：加号在发送按钮左边 */
.ai-chat-input-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
/* 【AI 额度】内置 AI 对话时，页面中部显示剩余额度进度条 */
.ai-chat-quota { display: flex; flex-direction: column; gap: 5px; padding: 6px 14px 4px; }
.ai-chat-quota[hidden] { display: none; }
.ai-chat-quota-bar { flex: 1 1 auto; height: 6px; border-radius: 3px; background: rgba(201,151,75,0.18); overflow: hidden; display: flex; }
.ai-chat-quota-fill { flex: 0 0 auto; height: 100%; width: 0%; border-radius: 3px 0 0 3px; background: linear-gradient(90deg,#e0bc5e,#c9974b); transition: width .4s var(--ease); }
.ai-chat-quota-fill.over { background: linear-gradient(90deg,#ff6b6b,#c0392b); }
.ai-chat-quota-text { flex: 0 0 auto; font-size: 12px; color: #c9974b; }
.ai-chat-quota-text.over { color: #ff6b6b; }
/* 周上限：紫色 */
.ai-chat-quota-bar.week { background: rgba(155,140,255,0.18); }
.ai-chat-quota-fill.week { background: linear-gradient(90deg,#9b8cff,#6a55d8); }
.ai-chat-quota-text.week { color: #9b8cff; }
/* 额外额度：青绿色（紧接在黄色后面，右端由轨道圆角裁剪） */
.ai-chat-quota-fill.extra { background: linear-gradient(90deg,#4ee2a5,#1f9e6f); border-radius: 0; }

/* ---------- 额度 · 快捷购买弹层 ---------- */
.ai-quota-buy-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.ai-quota-buy-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 10px;
    background: rgba(255,255,255,0.03); cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.ai-quota-buy-row:hover:not(.disabled) { border-color: #c9974b; background: rgba(201,151,75,0.08); }
.ai-quota-buy-row.disabled { opacity: 0.45; cursor: not-allowed; }
.ai-quota-buy-ic {
    flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(201,151,75,0.15); color: #e0bc5e; font-size: 12px;
}
.ai-quota-buy-main { flex: 1 1 auto; min-width: 0; }
.ai-quota-buy-name { font-size: 14px; color: var(--ink-text, inherit); }
.ai-quota-buy-desc { font-size: 12px; color: var(--ink-text-mute, #8a8a8a); margin-top: 2px; line-height: 1.5; }
.ai-quota-buy-tail { flex: 0 0 auto; font-size: 12px; color: #c9974b; }

/* ---------- 对话气泡里的「额度用完 + 快捷购买」 ---------- */
.ai-msg-quota-fix { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ai-msg-quota-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: 0;
    border: 1px solid rgba(201,151,75,0.55); background: rgba(201,151,75,0.12);
    color: #e0bc5e; font-size: 12px; cursor: pointer;
    transition: background .2s var(--ease), border-color .2s var(--ease);
}
.ai-msg-quota-btn:hover { background: rgba(201,151,75,0.22); }
.ai-msg-quota-tip { font-size: 12px; color: var(--ink-text-mute, #8a8a8a); }

/* ---------- 工作区：文件编辑步骤卡片（+N -M / diff） ---------- */
.ai-edit-card {
    margin-top: 10px; border: 1px solid var(--border); border-radius: 12px;
    background: rgba(255,255,255,0.025); overflow: hidden;
}
.ai-edit-head {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 9px 11px; background: transparent; border: 0; cursor: pointer;
    color: var(--ink-text-soft); text-align: left; font-size: 13px;
}
.ai-edit-head:hover { background: var(--surface-hover); }
.ai-edit-ic { font-size: 12px; color: var(--brass-bright); flex: 0 0 auto; }
.ai-edit-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-edit-stat { flex: 0 0 auto; font-size: 12px; letter-spacing: .3px; }
.ai-edit-stat .is-add { color: #4ba86b; font-weight: 600; }
.ai-edit-stat .is-del { color: #d4736f; font-weight: 600; }
.ai-edit-chev { flex: 0 0 auto; font-size: 10px; color: var(--ink-text-mute); transition: transform .2s; }
.ai-edit-card.is-open .ai-edit-chev { transform: rotate(90deg); }
.ai-edit-diff { display: none; border-top: 1px solid var(--border); background: rgba(0,0,0,0.16); }
.ai-edit-card.is-open .ai-edit-diff { display: block; }
.ai-diff-row {
    display: flex; gap: 8px; padding: 1px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
}
.ai-diff-sign { flex: 0 0 8px; opacity: .7; }
.ai-diff-text { flex: 1 1 auto; min-width: 0; color: var(--ink-text-soft); }
.ai-diff-row.is-add { background: rgba(75,168,107,0.13); }
.ai-diff-row.is-add .ai-diff-sign { color: #4ba86b; }
.ai-diff-row.is-del { background: rgba(212,115,111,0.13); }
.ai-diff-row.is-del .ai-diff-sign { color: #d4736f; }
.ai-diff-row.is-sep { color: var(--ink-text-mute); font-size: 11px; padding: 3px 10px; }
.ai-ws-edited { color: #4ba86b; font-size: 11px; flex: 0 0 auto; }

/* ---------- 压缩对话历史弹窗 ---------- */
.ai-cp-desc { font-size: 12.5px; color: var(--ink-text-mute); margin-bottom: 14px; }
.ai-cp-label { display: block; font-size: 12px; color: var(--brass-bright); margin-bottom: 6px; }
.ai-cp-input {
    width: 100%; box-sizing: border-box; padding: 9px 11px;
    border-radius: 10px; border: 1px solid var(--brass-dim, var(--border));
    background: rgba(255,255,255,0.04); color: var(--ink-text);
    font-size: 13px; outline: none;
}
.ai-cp-input::placeholder { color: var(--ink-text-mute); }
.ai-cp-keep { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.ai-cp-keep-tx { font-size: 13.5px; color: var(--ink-text-soft); }
.ai-cp-stepper { display: inline-flex; align-items: center; gap: 10px; }
.ai-cp-step {
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(140,140,190,0.20); color: var(--ink-text);
    font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.ai-cp-step:hover { background: rgba(140,140,190,0.32); }
.ai-cp-num { min-width: 22px; text-align: center; font-size: 16px; color: var(--ink-text); }
.ai-cp-tip { margin: 12px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-text-mute); }

/* ---------- 隐藏思考链的等待提示（gpt-6.2-sol 等不返回思考内容） ---------- */
.ai-msg-thinkwait {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 6px; font-size: 12.5px; color: var(--ink-text-mute);
}
.ai-msg-thinkwait i { color: var(--brass-bright); font-size: 12px; }

/* ---------- 代码块「复制」按钮 ---------- */
pre.ai-pre { position: relative; }
.ai-code-copy {
    position: absolute; top: 6px; right: 6px; z-index: 2;
    padding: 3px 8px; border-radius: 6px; font-size: 11px; line-height: 1.4;
    border: 1px solid var(--border); background: rgba(0,0,0,.55);
    color: var(--ink-text-mute); cursor: pointer;
    opacity: .7; transition: opacity .15s, color .15s, border-color .15s;
}
pre.ai-pre:hover .ai-code-copy { opacity: 1; }
.ai-code-copy:hover { color: var(--brass-bright); border-color: var(--brass-dim); }
