/*
 * Zhihuilu AI customer service widget.
 * Scoped to .verhi-ai-* so it cannot change header, footer or page layouts.
 */

body.verhi-ai-active .verhi-whatsapp-btn {
	display: none !important;
}

.verhi-ai-root {
	--vh-ai-red: #c7000b;
	--vh-ai-red-dark: #a30008;
	--vh-ai-blue: #2f6fd6;
	--vh-ai-cyan: #35b6e8;
	--vh-ai-ink: #16324f;
	--vh-ai-muted: #5b6b80;
	--vh-ai-line: #e3ebf5;
	--vh-ai-soft: #f5f8fd;
	--vh-ai-green: #25d366;
	--vh-ai-green-dark: #1ebe5d;
	position: fixed;
	right: 20px;
	bottom: 78px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--vh-ai-ink);
}

.verhi-ai-root[hidden] {
	display: none;
}

.verhi-ai-fab {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--vh-ai-blue), var(--vh-ai-cyan));
	color: #fff;
	box-shadow: 0 10px 26px rgba(47, 111, 214, 0.38), 0 2px 8px rgba(22, 50, 79, 0.16);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.verhi-ai-fab::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(53, 182, 232, 0.35);
	animation: verhi-ai-pulse 2.8s ease-out infinite;
	pointer-events: none;
}

.verhi-ai-fab:hover,
.verhi-ai-fab:focus-visible {
	background: linear-gradient(135deg, #2560c4, #2aa9dc);
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(47, 111, 214, 0.44), 0 4px 10px rgba(22, 50, 79, 0.18);
}

.verhi-ai-fab svg {
	display: block;
	width: 27px;
	height: 27px;
}

.verhi-ai-fab .verhi-ai-fab-close {
	display: none;
	width: 24px;
	height: 24px;
}

.verhi-ai-root.is-open .verhi-ai-fab-chat {
	display: none;
}

.verhi-ai-root.is-open .verhi-ai-fab-close {
	display: block;
}

.verhi-ai-root.is-open .verhi-ai-fab::before {
	animation: none;
	opacity: 0;
}

.verhi-ai-panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: min(640px, 78vh);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--vh-ai-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(22, 50, 79, 0.24), 0 6px 18px rgba(22, 50, 79, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.verhi-ai-root.is-open .verhi-ai-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.verhi-ai-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	background: linear-gradient(120deg, #16324f, #2f6fd6 58%, #35b6e8);
	color: #fff;
	flex: 0 0 auto;
}

.verhi-ai-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.35);
	font-size: 17px;
	font-weight: 700;
}

.verhi-ai-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.verhi-ai-title {
	min-width: 0;
	flex: 1 1 auto;
}

.verhi-ai-title strong {
	display: block;
	font-size: 15px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.verhi-ai-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	opacity: 0.92;
}

.verhi-ai-status i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #57e6a0;
	box-shadow: 0 0 0 2px rgba(87, 230, 160, 0.25);
}

.verhi-ai-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.verhi-ai-icon:hover,
.verhi-ai-icon:focus-visible {
	background: rgba(255, 255, 255, 0.26);
	transform: rotate(90deg);
}

.verhi-ai-icon svg {
	width: 18px;
	height: 18px;
}

.verhi-ai-body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.verhi-ai-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 16px 14px 8px;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c7d6ea transparent;
}

.verhi-ai-messages[hidden] {
	display: none;
}

.verhi-ai-msg {
	display: flex;
	margin-bottom: 12px;
}

.verhi-ai-msg-user {
	justify-content: flex-end;
}

.verhi-ai-bubble {
	max-width: 86%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.55;
	word-break: break-word;
}

.verhi-ai-msg-bot .verhi-ai-bubble {
	background: var(--vh-ai-soft);
	border: 1px solid var(--vh-ai-line);
	border-top-left-radius: 4px;
	color: var(--vh-ai-ink);
}

.verhi-ai-msg-user .verhi-ai-bubble {
	background: linear-gradient(135deg, var(--vh-ai-red), var(--vh-ai-red-dark));
	border-top-right-radius: 4px;
	color: #fff;
}

.verhi-ai-bubble p {
	margin: 0 0 8px;
}

.verhi-ai-bubble p:last-child {
	margin-bottom: 0;
}

.verhi-ai-bubble ul,
.verhi-ai-bubble ol {
	margin: 6px 0 8px;
	padding-left: 18px;
}

.verhi-ai-bubble li {
	margin-bottom: 4px;
}

.verhi-ai-bubble strong {
	font-weight: 700;
}

.verhi-ai-bubble a {
	color: var(--vh-ai-blue);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.verhi-ai-msg-user .verhi-ai-bubble a {
	color: #fff;
}

.verhi-ai-sources {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--vh-ai-line);
	font-size: 12px;
	color: var(--vh-ai-muted);
}

.verhi-ai-sources-title {
	font-weight: 700;
	margin-bottom: 4px;
}

.verhi-ai-sources a {
	display: block;
	padding: 2px 0;
	color: var(--vh-ai-blue);
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.verhi-ai-sources a:hover,
.verhi-ai-sources a:focus-visible {
	color: var(--vh-ai-red);
	text-decoration: underline;
}

.verhi-ai-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 13px 14px;
}

.verhi-ai-typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #9db4cc;
	animation: verhi-ai-blink 1.1s infinite ease-in-out;
}

.verhi-ai-typing i:nth-child(2) {
	animation-delay: 0.16s;
}

.verhi-ai-typing i:nth-child(3) {
	animation-delay: 0.32s;
}

.verhi-ai-email-form {
	flex: 0 0 auto;
	padding: 12px 14px;
	border-top: 1px solid var(--vh-ai-line);
	background: #fff;
}

.verhi-ai-email-form[hidden] {
	display: none;
}

.verhi-ai-email-title {
	font-weight: 700;
	color: var(--vh-ai-ink);
}

.verhi-ai-email-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 10px;
}

.verhi-ai-email-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--vh-ai-muted);
	cursor: pointer;
	transition: color 0.18s ease, background 0.18s ease;
}

.verhi-ai-email-back:hover,
.verhi-ai-email-back:focus-visible {
	background: var(--vh-ai-soft);
	color: var(--vh-ai-blue);
}

.verhi-ai-email-back svg {
	display: block;
	width: 16px;
	height: 16px;
}

.verhi-ai-email-form label {
	display: block;
	margin-bottom: 8px;
}

.verhi-ai-email-form label span {
	display: block;
	margin-bottom: 3px;
	font-size: 12px;
	color: var(--vh-ai-muted);
}

.verhi-ai-email-form input[type="text"],
.verhi-ai-email-form input[type="email"],
.verhi-ai-email-form textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--vh-ai-line);
	border-radius: 8px;
	background: #fff;
	color: var(--vh-ai-ink);
	font-size: 14px;
	padding: 8px 10px;
}

.verhi-ai-email-form input:focus,
.verhi-ai-email-form textarea:focus {
	outline: 2px solid rgba(47, 111, 214, 0.35);
	border-color: var(--vh-ai-blue);
}

.verhi-ai-email-form textarea {
	resize: vertical;
	min-height: 64px;
}

.verhi-ai-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.verhi-ai-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 16px;
	border: 0;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.verhi-ai-btn-primary {
	background: var(--vh-ai-blue);
	color: #fff;
}

.verhi-ai-btn-primary:hover,
.verhi-ai-btn-primary:focus-visible {
	background: #2560c4;
	transform: translateY(-1px);
}

.verhi-ai-btn:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.verhi-ai-quick {
	flex: 0 0 auto;
	padding: 0;
	border-top: 1px solid var(--vh-ai-line);
	background: #fff;
	overflow: hidden;
}

.verhi-ai-quick[hidden],
.verhi-ai-quick:empty {
	display: none;
}

.verhi-ai-quick-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 34px;
	padding: 6px 10px 6px 14px;
}

.verhi-ai-quick-label {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 11px;
	font-weight: 700;
	color: var(--vh-ai-muted);
	text-transform: uppercase;
	letter-spacing: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.verhi-ai-quick-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--vh-ai-muted);
	cursor: pointer;
	transition: color 0.18s ease, background 0.18s ease;
}

.verhi-ai-quick-toggle:hover,
.verhi-ai-quick-toggle:focus-visible {
	background: var(--vh-ai-soft);
	color: var(--vh-ai-blue);
}

.verhi-ai-quick-toggle svg {
	display: block;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.verhi-ai-quick-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 14px 10px;
}

.verhi-ai-quick.is-collapsed .verhi-ai-quick-chips {
	display: none;
}

.verhi-ai-chip {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 4px 12px;
	border: 1px solid var(--vh-ai-line);
	border-radius: 999px;
	background: var(--vh-ai-soft);
	color: var(--vh-ai-blue);
	font-size: 12px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.verhi-ai-chip:hover,
.verhi-ai-chip:focus-visible {
	border-color: var(--vh-ai-blue);
	background: #eaf2ff;
	color: var(--vh-ai-ink);
}

.verhi-ai-compose {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--vh-ai-line);
	background: #fff;
}

.verhi-ai-compose[hidden] {
	display: none;
}

.verhi-ai-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	box-sizing: border-box;
	padding: 0 13px;
	border: 1px solid var(--vh-ai-line);
	border-radius: 999px;
	background: var(--vh-ai-soft);
	color: var(--vh-ai-ink);
	font-size: 14px;
	outline: 0;
}

.verhi-ai-input:focus {
	border-color: var(--vh-ai-blue);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.18);
}

.verhi-ai-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--vh-ai-red);
	color: #fff;
	cursor: pointer;
	transition: background 0.18s ease, transform 0.18s ease;
}

.verhi-ai-send:hover,
.verhi-ai-send:focus-visible {
	background: var(--vh-ai-red-dark);
	transform: translateY(-1px);
}

.verhi-ai-send:disabled {
	opacity: 0.6;
	transform: none;
	cursor: wait;
}

.verhi-ai-send svg {
	width: 20px;
	height: 20px;
}

.verhi-ai-actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px 12px;
	border-top: 1px solid var(--vh-ai-line);
	background: #fafcff;
}

.verhi-ai-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #eef4fd;
	color: var(--vh-ai-blue);
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.verhi-ai-action svg {
	width: 20px;
	height: 20px;
}

.verhi-ai-action:hover,
.verhi-ai-action:focus-visible {
	transform: translateY(-2px);
}

.verhi-ai-whatsapp {
	background: rgba(37, 211, 102, 0.14);
	color: #1da851;
}

.verhi-ai-whatsapp:hover,
.verhi-ai-whatsapp:focus-visible {
	background: var(--vh-ai-green);
	color: #fff;
}

.verhi-ai-email {
	background: rgba(47, 111, 214, 0.12);
	color: var(--vh-ai-blue);
}

.verhi-ai-email:hover,
.verhi-ai-email:focus-visible {
	background: var(--vh-ai-blue);
	color: #fff;
}

.verhi-ai-phone {
	background: rgba(53, 182, 232, 0.14);
	color: #1687b8;
}

.verhi-ai-phone:hover,
.verhi-ai-phone:focus-visible {
	background: var(--vh-ai-cyan);
	color: #fff;
}

.verhi-ai-knowledge {
	background: rgba(22, 50, 79, 0.1);
	color: var(--vh-ai-ink);
}

.verhi-ai-knowledge:hover,
.verhi-ai-knowledge:focus-visible {
	background: var(--vh-ai-ink);
	color: #fff;
}

.verhi-ai-powered {
	margin: 0;
	padding: 6px 10px 8px;
	text-align: center;
	font-size: 11px;
	color: #9ab0c6;
	background: #fafcff;
	border-top: 1px solid var(--vh-ai-line);
}

.verhi-ai-hint {
	position: absolute;
	right: calc(100% + 12px);
	bottom: 10px;
	max-width: 230px;
	padding: 9px 13px;
	border: 1px solid var(--vh-ai-line);
	border-radius: 12px 12px 12px 2px;
	background: #fff;
	color: var(--vh-ai-ink);
	font-size: 13px;
	line-height: 1.45;
	box-shadow: 0 8px 24px rgba(22, 50, 79, 0.16);
	cursor: pointer;
	z-index: 1;
	animation: verhi-ai-hint-in 0.28s ease both;
}

.verhi-ai-hint::after {
	content: "";
	position: absolute;
	right: -6px;
	bottom: 14px;
	width: 12px;
	height: 12px;
	background: #fff;
	border-right: 1px solid var(--vh-ai-line);
	border-top: 1px solid var(--vh-ai-line);
	transform: rotate(45deg);
}

.verhi-ai-active-action {
	background: var(--vh-ai-blue) !important;
	color: #fff !important;
}

@keyframes verhi-ai-hint-in {
	from {
		opacity: 0;
		transform: translateX(8px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes verhi-ai-pulse {
	0% {
		transform: scale(0.9);
		opacity: 0.8;
	}
	70% {
		transform: scale(1.25);
		opacity: 0;
	}
	100% {
		transform: scale(1.25);
		opacity: 0;
	}
}

@keyframes verhi-ai-blink {
	0%,
	80%,
	100% {
		opacity: 0.25;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

@media (max-width: 767px) {
	.verhi-ai-root {
		right: 16px;
		bottom: 82px;
	}

	.verhi-ai-hint {
		right: calc(100% + 10px);
		bottom: 12px;
		max-width: 185px;
		font-size: 12px;
	}

	.verhi-ai-panel {
		position: fixed;
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: auto;
		max-width: none;
		height: min(84vh, 640px);
		border-radius: 16px;
		transform-origin: bottom center;
	}

	.verhi-ai-messages {
		padding: 14px 12px 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.verhi-ai-fab,
	.verhi-ai-fab::before,
	.verhi-ai-panel,
	.verhi-ai-icon,
	.verhi-ai-action,
	.verhi-ai-send,
	.verhi-ai-typing i {
		animation: none !important;
		transition: none !important;
	}
}

/* BetterDocs native launcher is replaced by the AI widget on docs pages.
   Only the floating launcher is hidden; docs content, sidebar and TOC stay untouched. */
body.verhi-ai-active .betterdocs-ia-launcher-wrapper,
body.verhi-ai-active .betterdocs-ia-main-wrapper {
	display: none !important;
}

.verhi-ai-email-form {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c7d6ea transparent;
}


.verhi-ai-file {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 120px;
	margin-bottom: 10px;
	border: 1px dashed #babfc3;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	cursor: pointer;
	transition: border-color 0.18s ease, background 0.18s ease;
}

.verhi-ai-file:hover,
.verhi-ai-file.is-dragover {
	border-color: var(--vh-ai-blue);
	background: var(--vh-ai-soft);
}

.verhi-ai-file-input {
	display: none;
}

.verhi-ai-file-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #eaecf0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
	color: var(--vh-ai-blue);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.verhi-ai-file-btn:hover,
.verhi-ai-file-btn:focus-visible {
	background: var(--vh-ai-soft);
	border-color: var(--vh-ai-blue);
	color: var(--vh-ai-blue);
}

.verhi-ai-file-btn svg {
	display: block;
	width: 22px;
	height: 22px;
}

.verhi-ai-file-label {
	margin: 10px 0 0;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--vh-ai-ink);
	text-align: center;
	line-height: 1.4;
	word-break: break-word;
}

.verhi-ai-file-hint {
	display: block;
	margin: 4px 0 0;
	padding: 0 12px;
	font-size: 12px;
	color: var(--vh-ai-muted);
	text-align: center;
	line-height: 1.4;
}

.verhi-ai-file-name {
	display: block;
	margin: 6px 0 0;
	padding: 0 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--vh-ai-blue);
	text-align: center;
	overflow-wrap: anywhere;
}

@media (max-width: 767px) {
}
