/* ============================================================
   FF Widget — 美化样式（功能测试阶段）
   ============================================================ */

/* 触发按钮 */
#ff-trigger-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, opacity 0.15s ease;
    z-index: 99998;
}
#ff-trigger-btn:hover { transform: translateY(-2px); opacity: 0.9; }
#ff-trigger-btn:active { transform: scale(0.97); }

/* 面板容器 */
#ff-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 580px;
    background: #fff;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.3s ease;
}
.ff-hidden {
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.ff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.07);
    flex-shrink: 0;
    color: #111;
}
.ff-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ff-header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.ff-header-info { display: flex; flex-direction: column; gap: 2px; }
.ff-header-name {
    font-size: 14px;
    font-weight: 500;
    color: #111;
    line-height: 1;
}
.ff-header-status {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ff-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

#ff-close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
#ff-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 进度条 */
.ff-progress-bar {
    height: 2px;
    background: #f3f4f6;
    flex-shrink: 0;
}
#ff-progress-fill {
    height: 100%;
    background: #111;
    transition: width 0.4s ease;
}

/* 聊天窗口 */
#ff-chat-window {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#ff-chat-window::-webkit-scrollbar { display: none; }

/* 消息气泡 */
.ff-message {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.ff-message.active {
    opacity: 1;
    transform: translateY(0);
}
.ff-message.past {
    opacity: 0.45;
    transform: translateY(-6px) scale(0.97);
    margin-bottom: 2px;
}

.ff-msg-ai {
    background: #f3f4f6;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.ff-msg-user {
    background: #111;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* 快捷选项 chips（可选，建议加上） */
.ff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 16px 12px;
    flex-shrink: 0;
}
.ff-chip {
    background: none;
    border: 0.5px solid #d1d5db;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.ff-chip:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* 输入区域 */
.ff-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.07);
    flex-shrink: 0;
}
#ff-input-text {
    flex: 1;
    border: 0.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    background: #f9fafb;
    color: #111;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}
#ff-input-text:focus {
    border-color: #9ca3af;
    background: #fff;
}
#ff-input-text::placeholder { color: #9ca3af; }

#ff-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
#ff-send-btn:hover { opacity: 0.8; }