﻿/* IntelliIAR 智能客服弹窗样式 - 由 JS 动态加载 */
.ai-chat-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(4px);
	z-index: 10000;
	animation: fadeIn 0.25s ease;
}

.ai-chat-window {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	width: min(680px, calc(100vw - 24px));
	height: min(820px, calc(100vh - 48px));
	max-height: calc(100vh - 48px);
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	border-radius: 20px;
	border: 1px solid rgba(102, 126, 234, 0.2);
	box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255,255,255,0.8) inset;
	z-index: 10001;
	display: flex;
	flex-direction: column;
	animation: csChatSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}

@keyframes csChatSlideUp {
	from { transform: translateX(-50%) translateY(24px); opacity: 0; }
	to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes slideUp {
	from {
		transform: translateY(100px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.ai-chat-header {
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
	color: #fff;
	padding: 18px 22px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.ai-chat-title {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cs-header-bot-icon {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: rgba(255,255,255,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.cs-header-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

#ai-chat-title-text {
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.cs-header-sub {
	font-size: 11px;
	opacity: 0.85;
	font-weight: 400;
}

.ai-chat-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 20px;
	cursor: pointer;
	padding: 5px;
	transition: transform 0.2s ease;
}

.ai-chat-close:hover {
	transform: rotate(90deg);
}

.ai-chat-suggestions {
	padding: 8px 12px 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.ai-chat-suggestion-btn {
	border: 1px solid #c7d2fe;
	background: #eef2ff;
	color: #4338ca;
	border-radius: 18px;
	padding: 6px 12px;
	font-size: 12px;
	cursor: pointer;
	max-width: 100%;
	text-align: left;
	line-height: 1.35;
}
.ai-chat-suggestion-btn:hover {
	background: #e0e7ff;
}

.ai-chat-body {
	flex: 1;
	padding: 20px 22px;
	overflow-y: auto;
	background: #f1f5f9;
	background-image: radial-gradient(circle at 20% 20%, rgba(99,102,241,0.06) 0%, transparent 50%),
		radial-gradient(circle at 80% 80%, rgba(124,58,237,0.06) 0%, transparent 50%);
}

.ai-chat-message {
	display: flex;
	margin-bottom: 18px;
	align-items: flex-start;
	gap: 12px;
	max-width: 100%;
}

.ai-chat-message.ai-message {
	justify-content: flex-start;
}

.ai-chat-message.user-message {
	flex-direction: row;
	justify-content: flex-end;
	width: 100%;
	margin-left: auto;
}

.cs-chat-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	flex-shrink: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.cs-chat-avatar.ai-avatar {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #fff;
}

.cs-chat-avatar.user-avatar {
	background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
	color: #4338ca;
	font-weight: 700;
	font-size: 16px;
}

.cs-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.cs-avatar-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cs-ai-icon {
	font-size: 20px;
}

.ai-message-content, .user-message-content {
	max-width: min(78%, 420px);
	padding: 14px 18px;
	border-radius: 16px;
	font-size: 15px;
	line-height: 1.65;
	word-break: break-word;
}

.ai-message-content {
	background: #fff;
	color: #1e293b;
	border: 1px solid #e2e8f0;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
	border-top-left-radius: 4px;
}

.user-message-content {
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	color: #fff;
	border-top-right-radius: 4px;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.ai-message-content .cs-msg-text,
.user-message-content .cs-msg-text {
	margin: 0;
	white-space: pre-wrap;
}

.cs-typing-bubble {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 14px 18px !important;
	min-height: 24px;
}

.cs-typing-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #94a3b8;
	animation: csTypingBounce 1.2s infinite ease-in-out;
}

.cs-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.cs-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes csTypingBounce {
	0%, 80%, 100% { transform: scale(0.75); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

.ai-chat-footer {
	border-top: 1px solid rgba(226, 232, 240, 0.9);
	background: linear-gradient(180deg, #fafbff 0%, #ffffff 100%);
	flex-shrink: 0;
	position: relative;
}

.ai-chat-window .ai-chat-footer button {
	font-family: inherit;
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
}

.ai-chat-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px 8px;
	flex-wrap: wrap;
	position: relative;
	z-index: 6;
	pointer-events: auto;
}

.ai-chat-window .cs-tool-btn,
.ai-chat-window .cs-tool-btn * {
	pointer-events: auto;
	cursor: pointer;
}

.ai-chat-window .cs-tool-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px 8px 8px;
	border-radius: 12px;
	border: none;
	background: #fff;
	color: #334155;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.9);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ai-chat-window .cs-tool-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.12), 0 0 0 1px rgba(199, 210, 254, 0.8);
	background: #fafaff;
}

.ai-chat-window .cs-tool-btn.active {
	background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35), 0 4px 12px rgba(99, 102, 241, 0.15);
	color: #4338ca;
}

.cs-tool-icon-wrap {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	flex-shrink: 0;
}

.cs-icon-voice {
	background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
	color: #1d4ed8;
}

.cs-icon-image {
	background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
	color: #047857;
}

.cs-icon-file {
	background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
	color: #4338ca;
}

.cs-icon-order {
	background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
	color: #be185d;
}

.cs-tool-label {
	line-height: 1;
	letter-spacing: 0.02em;
}

.cs-order-panel {
	display: none;
	padding: 0 18px 10px;
}

.cs-order-panel.open {
	display: block;
}

.cs-order-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 14px;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), 0 0 0 1px rgba(226, 232, 240, 0.9);
}

.cs-order-card::before {
	content: '';
	width: 4px;
	height: 28px;
	border-radius: 4px;
	background: linear-gradient(180deg, #6366f1, #8b5cf6);
	flex-shrink: 0;
}

.ai-chat-window .cs-order-input {
	flex: 1;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid transparent;
	border-radius: 10px;
	font-size: 14px;
	outline: none;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ai-chat-window .cs-order-input:focus {
	border-color: #a5b4fc;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.ai-chat-window .cs-order-submit {
	padding: 10px 18px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
	transition: transform 0.2s, box-shadow 0.2s;
}

.ai-chat-window .cs-order-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.ai-chat-window .cs-order-close {
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 10px;
	background: #fff;
	color: #94a3b8;
	cursor: pointer;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	transition: color 0.2s, background 0.2s;
}

.ai-chat-window .cs-order-close:hover {
	color: #64748b;
	background: #f1f5f9;
}

.cs-tool-toast {
	position: absolute;
	left: 50%;
	top: -8px;
	transform: translate(-50%, -100%);
	background: rgba(15, 23, 42, 0.88);
	color: #fff;
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 8px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
	white-space: nowrap;
	z-index: 2;
}

.cs-tool-toast.show {
	opacity: 1;
}

.cs-cap-banner {
	flex-shrink: 0;
	margin: 0 14px;
	padding: 8px 12px;
	font-size: 12px;
	line-height: 1.45;
	color: #92400e;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-radius: 10px;
}

.cs-cap-banner[hidden] {
	display: none !important;
}

.cs-msg-attach {
	margin-top: 8px;
}

.cs-msg-image {
	max-width: 200px;
	max-height: 140px;
	border-radius: 10px;
	display: block;
}

.ai-chat-input-area {
	padding: 6px 18px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.ai-chat-window .ai-chat-new-btn {
	width: 48px;
	height: 48px;
	min-width: 48px;
	padding: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
	color: #fff;
	border: none;
	outline: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
	box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ai-chat-window .ai-chat-new-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.ai-chat-window .ai-chat-new-btn:active {
	transform: translateY(0);
	opacity: 0.92;
}

.ai-chat-window .ai-chat-new-btn i {
	pointer-events: none;
}

.ai-chat-input {
	flex: 1;
	padding: 14px 18px;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background: #f8fafc;
}

.ai-chat-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
	background: #fff;
}

.ai-chat-window .ai-chat-send {
	width: 48px;
	height: 48px;
	min-width: 48px;
	padding: 0;
	border-radius: 14px;
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #fff;
	border: none;
	outline: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
	box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-window .ai-chat-send:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 22px rgba(79, 70, 229, 0.45);
}

@media (max-width: 768px) {
	.ai-chat-window {
		left: 50%;
		transform: translateX(-50%);
		width: calc(100vw - 16px);
		height: calc(100vh - 16px);
		bottom: 8px;
		border-radius: 16px;
	}
}

