/* AI 报修助手聊天组件样式 */
#ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

#ai-chat-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
    position: relative;
}
#ai-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(102,126,234,0.6);
}
#ai-chat-btn .pulse-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0%,100% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
}

#ai-chat-panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 360px;
    height: 480px;
    background: rgba(22,24,30,0.97);
    border: 1px solid rgba(102,126,234,0.3);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}
#ai-chat-panel.show {
    display: flex;
}

.chat-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}
.chat-header .close-btn {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chat-header .close-btn:hover { opacity: 1; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
    animation: msg-in 0.3s ease;
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-ai {
    align-self: flex-start;
    background: rgba(102,126,234,0.18);
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}
.msg-user {
    align-self: flex-end;
    background: rgba(102,126,234,0.35);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.quick-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
}
.quick-btn {
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.quick-btn:hover {
    background: rgba(102,126,234,0.25);
    border-color: rgba(102,126,234,0.5);
    color: #fff;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 8px;
}
.chat-input-area input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-area input:focus {
    border-color: rgba(102,126,234,0.5);
}
.chat-input-area input::placeholder { color: #666; }

.chat-input-area button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #fff;
}
.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(102,126,234,0.4);
}
.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.typing-indicator {
    align-self: flex-start;
    padding: 10px 14px;
    background: rgba(102,126,234,0.12);
    border-radius: 12px;
    display: none;
}
.typing-indicator.show { display: flex; gap: 4px; }
.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    animation: typing-dot 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
    0%,60%,100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* 确认提交弹窗 */
#ai-confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#ai-confirm-box {
    background: #fff;
    border-radius: 16px;
    width: 340px;
    max-width: 90vw;
    padding: 24px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
    animation: cf-in 0.25s ease;
}
@keyframes cf-in {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
#ai-confirm-box h3 {
    margin: 0 0 16px 0;
    font-size: 17px;
    color: #333;
    text-align: center;
}
.confirm-info {
    margin-bottom: 16px;
}
.cf-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.cf-row:last-child { border-bottom: none; }
.cf-label { color: #888; width: 52px; flex-shrink: 0; }
.cf-value { color: #333; font-weight: 500; word-break: break-all; }

.cf-phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.cf-phone-row label {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}
.cf-phone-row input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.cf-phone-row input:focus { border-color: #667eea; }
.cf-phone-row input::placeholder { color: #aaa; }
.cf-hint { font-size: 12px; color: #999; white-space: nowrap; }

.cf-buttons {
    display: flex;
    gap: 12px;
}
.cf-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}
.cf-btn:hover { background: #eee; }
.cf-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    font-weight: bold;
}
.cf-btn.primary:hover {
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
