/* ============================================================
   AI 助教「小幻语」增强样式
   在原面板基础上补充：流式回答、工具调用卡片、安全拦截、思考态
   ============================================================ */

/* ---------- 思考中占位 ---------- */
.assistant-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #7fb4cc;
}

.assistant-dots {
    display: inline-flex;
    gap: 3px;
}

.assistant-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2ee6ff;
    animation: assistantBlink 1.2s infinite;
}

.assistant-dots i:nth-child(2) { animation-delay: 0.15s; }
.assistant-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes assistantBlink {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* ---------- 工具调用卡片 ---------- */
.assistant-tool {
    align-self: flex-start;
    max-width: 92%;
    margin: 2px 0;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 11.5px;
    color: #9fe8fa;
    background: rgba(46, 230, 255, 0.06);
    border: 1px dashed rgba(46, 230, 255, 0.35);
    animation: assistantToolIn 0.25s ease-out;
}

@keyframes assistantToolIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.assistant-tool-title {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.assistant-tool-detail {
    margin-top: 5px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10.5px;
    line-height: 1.6;
    color: #7fb4cc;
    word-break: break-all;
}

.assistant-tool.done {
    border-style: solid;
    border-color: rgba(52, 211, 153, 0.42);
    color: #9cf0cd;
}

.assistant-tool.done .assistant-tool-detail {
    color: #86d9c0;
}

/* ---------- 安全拦截气泡 ---------- */
.assistant-message.blocked {
    color: #ffe1a3 !important;
    background: rgba(251, 191, 36, 0.12) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
}

/* ---------- 流式输出光标 ---------- */
.assistant-message.assistant.streaming::after {
    content: "▍";
    margin-left: 2px;
    color: #2ee6ff;
    animation: assistantBlink 1s steps(2) infinite;
}

/* ============================================================
   多模态：拍照识别
   ============================================================ */

/* 相机按钮 */
.assistant-camera {
    flex: none;
    width: 38px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #9fe8fa;
    background: rgba(46, 230, 255, 0.08);
    border: 1px solid rgba(46, 230, 255, 0.28);
    transition: all 0.2s ease;
}

.assistant-camera:hover {
    color: #eafcff;
    background: rgba(46, 230, 255, 0.2);
    border-color: rgba(46, 230, 255, 0.7);
    box-shadow: 0 0 14px rgba(46, 230, 255, 0.35);
}

.assistant-camera:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* 用户上传的图片缩略图 */
.assistant-thumb {
    max-width: 160px;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid rgba(46, 230, 255, 0.35);
    object-fit: cover;
    display: block;
}

/* 识别结果卡片 */
.assistant-vision {
    align-self: flex-start;
    max-width: 94%;
    padding: 12px 14px;
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(12, 32, 52, 0.95), rgba(7, 20, 34, 0.95));
    border: 1px solid rgba(46, 230, 255, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: assistantToolIn 0.25s ease-out;
}

.assistant-vision-type {
    font-size: 10.5px;
    letter-spacing: 0.12em;
    color: #6f97b0;
    margin-bottom: 7px;
}

.assistant-vision-content {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
    color: #9fe8fa;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
    word-break: break-word;
}

.assistant-vision-row {
    display: flex;
    gap: 7px;
    font-size: 12px;
    line-height: 1.65;
    color: #bdd7e6;
    margin-top: 5px;
}

.assistant-vision-row .label {
    flex: none;
    color: #7fb4cc;
}

.assistant-vision-balance {
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12.5px;
    color: #9cf0cd;
    background: rgba(52, 211, 153, 0.09);
    border-left: 2px solid rgba(52, 211, 153, 0.6);
}

.assistant-vision-balance.invalid {
    color: #ffc978;
    background: rgba(251, 191, 36, 0.09);
    border-left-color: rgba(251, 191, 36, 0.6);
}

.assistant-vision-safety {
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #ffe1a3;
    background: rgba(251, 191, 36, 0.1);
    border-left: 2px solid rgba(251, 191, 36, 0.65);
}

.assistant-vision-low {
    margin-top: 6px;
    font-size: 11px;
    color: #ff9f9f;
}
