/* AI 评论助手 - 前端聊天机器人样式 */

#acb-chat-root {
	--acb-color: #6366f1;
	--acb-color-dark: #4f46e5;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.acb-chat-toggle {
	position: relative;
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	background: var(--acb-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, background 0.2s ease;
	margin-left: auto;
}

.acb-chat-toggle:hover {
	background: var(--acb-color-dark);
	transform: scale(1.05);
}

.acb-chat-icon,
.acb-chat-close {
	display: flex;
	align-items: center;
	justify-content: center;
}

.acb-chat-close {
	display: none;
}

#acb-chat-root.open .acb-chat-icon {
	display: none;
}

#acb-chat-root.open .acb-chat-close {
	display: flex;
}

.acb-chat-panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 480px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.96);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
	transform-origin: bottom right;
}

#acb-chat-root.open .acb-chat-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.acb-chat-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: var(--acb-color);
	color: #fff;
}

.acb-chat-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
}

.acb-chat-header-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.acb-chat-header-text strong {
	font-size: 15px;
}

.acb-chat-status {
	font-size: 12px;
	opacity: 0.85;
}

.acb-chat-status::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	margin-right: 5px;
	vertical-align: middle;
}

.acb-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f7f8fa;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.acb-msg {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
	white-space: pre-wrap;
}

.acb-msg.assistant {
	align-self: flex-start;
	background: #fff;
	color: #1f2329;
	border: 1px solid #e5e7eb;
	border-bottom-left-radius: 4px;
}

.acb-msg.user {
	align-self: flex-end;
	background: var(--acb-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.acb-msg.typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 14px 16px;
}

.acb-msg.typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #cbd5e1;
	animation: acb-bounce 1.2s infinite ease-in-out;
}

.acb-msg.typing span:nth-child(2) {
	animation-delay: 0.15s;
}

.acb-msg.typing span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes acb-bounce {
	0%,
	80%,
	100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	40% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

.acb-chat-input-wrap {
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid #eef0f2;
}

.acb-chat-input-wrap form {
	display: flex;
	align-items: center;
	gap: 8px;
}

.acb-chat-input-wrap input {
	flex: 1;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.2s;
}

.acb-chat-input-wrap input:focus {
	border-color: var(--acb-color);
}

.acb-chat-input-wrap button {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--acb-color);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	flex-shrink: 0;
}

.acb-chat-input-wrap button:hover {
	background: var(--acb-color-dark);
}

.acb-chat-input-wrap button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	.acb-chat-panel {
		width: calc(100vw - 32px);
		right: 0;
	}
	#acb-chat-root {
		right: 16px;
		bottom: 16px;
	}
}
