/* AI小助手样式 — 与星空主题匹配（v20260903） */
.ai-fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(230, 126, 34, 0.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 9998;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, background 0.2s;
    border: none;
}
.ai-fab:hover { background: rgba(230, 126, 34, 1); transform: scale(1.08); }

.ai-panel {
    position: fixed;
    bottom: 134px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 170px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ai-panel.hidden { display: none; }

.ai-header {
    background: linear-gradient(135deg, #2563A0, #1d4f80);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ai-header-title { font-size: 15px; font-weight: bold; }
.ai-header-sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.ai-header-btns { display: flex; gap: 6px; }
.ai-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
}
.ai-header-btn:hover { background: rgba(255, 255, 255, 0.3); }

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-msg { max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user { align-self: flex-end; background: #2563A0; color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: #fff; color: #333; border: 1px solid #e3e8ef; border-bottom-left-radius: 4px; }
.ai-msg.error { align-self: center; background: #fff3f0; color: #c0392b; border: 1px solid #f5c6bc; font-size: 12.5px; }
.ai-msg.loading { color: #999; font-size: 12.5px; }

.ai-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: #f5f7fa;
    border-top: 1px solid #eceff4;
    flex-shrink: 0;
}
.ai-quick-btn {
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #cfd8e3;
    background: #fff;
    color: #2563A0;
    cursor: pointer;
}
.ai-quick-btn:hover { background: #eaf2fb; }

.ai-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e3e8ef;
    background: #fff;
    flex-shrink: 0;
}
.ai-input {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
    box-sizing: border-box;
}
.ai-input:focus { border-color: #2563A0; }
.ai-send {
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: #2563A0;
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
    flex-shrink: 0;
}
.ai-send:disabled { background: #9db6d0; cursor: not-allowed; }

@media (max-width: 480px) {
    .ai-panel { height: calc(100vh - 140px); }
}
