@charset "utf-8";
/**
 * AI 在线客服 - PC 端浮窗外壳样式（启动器 FAB + 400x640 浮层面板 + 骨架屏）
 * 主题：tyalux
 * 深圳市爱租网络有限公司2016-2026
 * Shenzhen iZucn Network Co.,Ltd. 2016-2026
 *
 * 结构（markup 由 includes/modules/ai_chat/ai_chat_launcher.php 输出）：
 *   .izc-launcher
 *     .izc-panel > .izc-loading（骨架屏） + iframe.izc-frame
 *   （.izc-fab-wrap 启动器当前不输出：面板入口由页脚 / 快捷面板 / 首页 dock
 *    客服按钮调用 AIChatLauncher.open() 唤起，避免同一页面重复挂多个客服入口）
 *
 * 状态类（由 js/ai_chat_launcher.js 切换）：
 *   .izc-launcher.is-open   —— 面板展开
 *   .izc-launcher.is-loaded —— iframe 已加载（骨架屏淡出）
 *
 * 约定：
 * 1. 颜色 / 圆角全部取主题令牌（--color-*、--radius-*），换主题配色自动跟随；
 * 2. z-index 99990 / 99989，低于 purebox 起始值 100000，避免遮挡系统弹窗；
 * 3. 移动端（<=640px）面板全屏，不锁死滚动导致 iframe 内消息区不能滚动。
 */

/* ============================================================
 * 1. 根节点与局部令牌
 * ============================================================ */
.izc-launcher,
.izc-launcher * {
	box-sizing: border-box;
}
.izc-launcher {
	/* 主题令牌映射（vars 缺失时回落到本主题默认配色） */
	--izc-primary: var(--color-primary, #232f3e);
	--izc-primary-dark: var(--color-primary-dark, #1b2530);
	--izc-primary-light: var(--color-primary-light, #f0f4f8);
	--izc-primary-lighter: var(--color-primary-lighter, #f7f8fa);
	--izc-promo: var(--color-promo, #febd69);
	--izc-text: var(--color-text, #333333);
	--izc-text-muted: var(--color-text-muted, #6f6f6f);
	--izc-border: var(--color-border, #eeeeee);
	--izc-radius-lg: var(--radius-lg, 16px);
	/* 尺寸 */
	--izc-edge: 24px;   /* 距视口右下边距 */
	--izc-fab: 56px;    /* 启动器直径 */
	--izc-gap: 14px;    /* 面板与启动器间隙 */
	position: fixed;
	right: 0;
	bottom: 0;
	width: 0;
	height: 0;
	z-index: 99990;
	font-family: inherit;
	color: var(--izc-text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}
.izc-launcher svg {
	display: block;
}
.izc-launcher .izc-fab {
	float: none;
}

/* ============================================================
 * 2. 浮层面板（820x640，右下弹出，左下角为缩放原点）
 *    宽度按两栏布局设计：左栏会话列表 272 + 右栏对话区，窄屏自动收缩
 * ============================================================ */
.izc-panel {
	position: fixed;
	right: var(--izc-edge);
	bottom: var(--izc-edge);
	width: 820px;
	max-width: calc(100vw - var(--izc-edge) * 2);
	height: 640px;
	max-height: calc(100vh - var(--izc-edge) * 2);
	background: #fff;
	border-radius: var(--izc-radius-lg);
	overflow: hidden;
	/* 三层阴影：贴边描边 + 中景扩散 + 远景抬升 */
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, .06),
		0 10px 30px -6px rgba(15, 23, 42, .18),
		0 28px 64px -16px rgba(15, 23, 42, .24);
	transform-origin: 100% 100%;
	transform: translateY(14px) scale(.94);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity .2s ease,
		transform .26s cubic-bezier(.22, 1, .36, 1),
		visibility 0s linear .26s;
	z-index: 99990;
	-webkit-overflow-scrolling: touch;
}
.izc-launcher.is-open .izc-panel {
	transform: none;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition:
		opacity .2s ease,
		transform .3s cubic-bezier(.22, 1, .36, 1),
		visibility 0s linear 0s;
}

/* iframe：加载完成后淡入，避免白屏闪 */
.izc-frame {
	display: block;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
	opacity: 0;
	transition: opacity .3s ease;
}
.izc-launcher.is-loaded .izc-frame {
	opacity: 1;
}

/* 拖动热区：盖在 iframe 头部空白区，负责发起面板拖动
 * （父页元素：mousedown 落在 iframe 内时后续指针事件归 iframe 文档，父页会断流） */
.izc-drag-handle {
	position: absolute;
	top: 0;
	left: 0;
	right: 90px;
	height: 58px;
	z-index: 2;
	cursor: move;
	background: transparent;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
@media (max-width: 640px) {
	/* 窄屏面板全屏铺满，无自由定位需求 */
	.izc-drag-handle {
		display: none !important;
	}
}

/* 面板拖动中：全局禁止文本选中、光标统一为移动态（位移由 js/ai_chat_launcher.js 接管） */
body.izc-dragging,
body.izc-dragging * {
	cursor: move !important;
	user-select: none !important;
	-webkit-user-select: none !important;
}

/* ============================================================
 * 3. 骨架屏（连接中）
 * ============================================================ */
.izc-loading {
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
	z-index: 2;
	transition: opacity .3s ease, visibility 0s linear 0s;
}
.izc-launcher.is-loaded .izc-loading {
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility 0s linear .3s;
}
/* 头部拟真条：品牌色 + 头像 + 两行占位 */
.izc-loading-hd {
	flex: none;
	display: flex;
	align-items: center;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--izc-primary) 0%, var(--izc-primary-dark) 100%);
}
.izc-loading-avatar {
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.izc-loading-hd .izc-sk {
	background: rgba(255, 255, 255, .24);
}
.izc-loading-hd .izc-sk::after {
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
}
.izc-sk {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	background: #eef1f5;
}
.izc-sk::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
	animation: izcShimmer 1.5s ease-in-out infinite;
}
.izc-sk-line {
	height: 10px;
}
.izc-sk-w1 {
	width: 104px;
	margin-left: 10px;
}
.izc-sk-w2 {
	width: 56px;
	margin-left: auto;
}
/* 消息气泡占位：左 / 右交替，模拟真实对话节奏 */
.izc-loading-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 20px 16px;
	background: var(--izc-primary-lighter);
}
.izc-sk-bubble {
	height: 46px;
	border-radius: 12px;
}
.izc-sk-left {
	align-self: flex-start;
	width: 64%;
	border-bottom-left-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.izc-sk-right {
	align-self: flex-end;
	width: 54%;
	margin-top: 14px;
	border-bottom-right-radius: 4px;
	background: var(--izc-primary-light);
}
.izc-sk-sm {
	width: 42%;
	height: 36px;
	margin-top: 14px;
}
/* 底部连接文案 + 旋转环 */
.izc-loading-text {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px 16px 22px;
	background: var(--izc-primary-lighter);
	font-size: 12px;
	line-height: 18px;
	color: var(--izc-text-muted);
	text-align: center;
	word-break: break-word;
}
.izc-loading-text::before {
	content: '';
	flex: none;
	width: 12px;
	height: 12px;
	margin-right: 6px;
	border-radius: 50%;
	border: 2px solid var(--izc-border);
	border-top-color: var(--izc-primary);
	animation: izcSpin .8s linear infinite;
}

/* ============================================================
 * 4. 启动器 FAB（当前已停用：外壳只输出面板，避免同一页面重复挂多个客服入口；
 *    样式保留，便于个别站点需要时重新启用）
 * ============================================================ */
.izc-fab-wrap {
	position: fixed;
	right: var(--izc-edge);
	bottom: var(--izc-edge);
	width: var(--izc-fab);
	height: var(--izc-fab);
	z-index: 99989;
	/* 首屏延迟入场：让主内容先出，避免抢第一眼注意力 */
	animation: izcFabIn .5s cubic-bezier(.22, 1, .36, 1) .5s both;
}
.izc-launcher .izc-fab {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(140deg, var(--izc-primary) 0%, var(--izc-primary-dark) 100%);
	color: #fff;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	box-shadow:
		0 2px 6px rgba(15, 23, 42, .2),
		0 8px 20px -4px rgba(15, 23, 42, .32);
	transition: transform .22s cubic-bezier(.22, 1, .36, 1), box-shadow .22s ease;
	-webkit-tap-highlight-color: transparent;
}
.izc-launcher .izc-fab:hover {
	transform: translateY(-2px) scale(1.04);
	box-shadow:
		0 2px 8px rgba(15, 23, 42, .22),
		0 14px 28px -6px rgba(15, 23, 42, .38);
}
.izc-launcher .izc-fab:active {
	transform: translateY(0) scale(.96);
	transition-duration: .08s;
}
.izc-launcher .izc-fab:focus-visible {
	outline: 2px solid var(--izc-promo);
	outline-offset: 3px;
}
/* 图标 morph：气泡 ⇄ 关闭叉（旋转 + 缩放交叉淡出） */
.izc-fab-ico,
.izc-fab-ico-x {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 26px;
	height: 26px;
	margin: -13px 0 0 -13px;
	transition: opacity .18s ease, transform .26s cubic-bezier(.22, 1, .36, 1);
}
.izc-fab-ico-x {
	opacity: 0;
	transform: rotate(-90deg) scale(.5);
}
.izc-launcher.is-open .izc-fab-ico {
	opacity: 0;
	transform: rotate(90deg) scale(.5);
}
.izc-launcher.is-open .izc-fab-ico-x {
	opacity: 1;
	transform: none;
}
/* 在线点 + 呼吸环 */
.izc-fab-dot {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 12px;
	height: 12px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #22c55e;
	transition: opacity .2s ease;
}
.izc-fab-dot::after {
	content: '';
	position: absolute;
	left: -2px;
	top: -2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: rgba(34, 197, 94, .55);
	animation: izcPulse 2.4s ease-out infinite;
}
.izc-launcher.is-open .izc-fab-dot {
	opacity: 0;
}
/* 未读徽章 */
.izc-badge {
	display: none;
	position: absolute;
	right: -3px;
	top: -3px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	line-height: 18px;
	font-weight: 700;
	text-align: center;
	font-style: normal;
	box-shadow: 0 0 0 2px #fff;
}
.izc-badge.is-on {
	display: block;
	animation: izcPop .3s cubic-bezier(.34, 1.56, .64, 1);
}
/* 左侧悬浮提示（关闭态显示） */
.izc-tip {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	display: flex;
	align-items: center;
	max-width: 220px;
	min-height: 32px;
	padding: 6px 12px;
	border-radius: 8px;
	background: rgba(23, 28, 38, .92);
	color: #fff;
	font-size: 12px;
	line-height: 16px;
	text-align: left;
	white-space: normal;
	word-break: break-word;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%) translateX(6px);
	box-shadow: 0 4px 14px rgba(15, 23, 42, .2);
	transition: opacity .2s ease, transform .2s ease;
}
.izc-tip::after {
	content: '';
	position: absolute;
	left: 100%;
	top: 50%;
	margin-top: -5px;
	border: 5px solid transparent;
	border-left-color: rgba(23, 28, 38, .92);
}
.izc-fab-wrap:hover .izc-tip,
.izc-fab:focus-visible ~ .izc-tip {
	opacity: 1;
	transform: translateY(-50%) translateX(0);
}
.izc-launcher.is-open .izc-tip {
	opacity: 0;
	transform: translateY(-50%) translateX(6px);
}

/* ============================================================
 * 5. 动画
 * ============================================================ */
@keyframes izcFabIn {
	from { opacity: 0; transform: translateY(14px) scale(.82); }
	to { opacity: 1; transform: none; }
}
@keyframes izcShimmer {
	0% { transform: translateX(-100%); }
	60%, 100% { transform: translateX(100%); }
}
@keyframes izcSpin {
	to { transform: rotate(360deg); }
}
@keyframes izcPulse {
	0% { transform: scale(1); opacity: .85; }
	70% { transform: scale(2.6); opacity: 0; }
	100% { transform: scale(2.6); opacity: 0; }
}
@keyframes izcPop {
	from { transform: scale(.4); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

/* ============================================================
 * 6. 窄屏（<=640px）：面板全屏，FAB 缩小贴近边缘
 * ============================================================ */
@media (max-width: 640px) {
	.izc-launcher {
		--izc-edge: 16px;
		--izc-fab: 52px;
	}
	.izc-panel {
		right: 0;
		bottom: 0;
		left: 0;
		top: 0;
		width: auto;
		max-width: none;
		height: auto;
		max-height: none;
		border-radius: 0;
		transform-origin: 50% 100%;
		transform: translateY(20px);
		box-shadow: none;
	}
	.izc-tip {
		display: none;
	}
	html.izc-no-scroll,
	html.izc-no-scroll body {
		overflow: hidden;
	}
}

/* ============================================================
 * 7. RTL（阿拉伯语等）：面板 / FAB / 提示整体镜像到左下角
 * ============================================================ */
html[dir="rtl"] .izc-panel {
	right: auto;
	left: var(--izc-edge);
	transform-origin: 0 100%;
}
html[dir="rtl"] .izc-launcher.is-open .izc-panel {
	transform: none;
}
html[dir="rtl"] .izc-fab-wrap {
	right: auto;
	left: var(--izc-edge);
}
html[dir="rtl"] .izc-badge {
	right: auto;
	left: -3px;
}
html[dir="rtl"] .izc-fab-dot {
	right: auto;
	left: 0;
}
html[dir="rtl"] .izc-tip {
	right: auto;
	left: calc(100% + 12px);
	text-align: right;
	transform: translateY(-50%) translateX(-6px);
}
html[dir="rtl"] .izc-tip::after {
	left: auto;
	right: 100%;
	border-left-color: transparent;
	border-right-color: rgba(23, 28, 38, .92);
}
html[dir="rtl"] .izc-fab-wrap:hover .izc-tip,
html[dir="rtl"] .izc-fab:focus-visible ~ .izc-tip {
	transform: translateY(-50%) translateX(0);
}
html[dir="rtl"] .izc-launcher.is-open .izc-tip {
	transform: translateY(-50%) translateX(-6px);
}
html[dir="rtl"] .izc-sk-right {
	align-self: flex-start;
	margin-left: 0;
}
html[dir="rtl"] .izc-sk-left {
	align-self: flex-end;
}
html[dir="rtl"] .izc-sk-left {
	border-radius: 12px;
	border-bottom-right-radius: 4px;
}
html[dir="rtl"] .izc-sk-right {
	border-radius: 12px;
	border-bottom-left-radius: 4px;
}
@media (max-width: 640px) {
	/* RTL 下 right 被镜像规则改成 auto，窄屏全屏必须显式补齐 right / width，否则面板收缩为 0 宽 */
	html[dir="rtl"] .izc-panel {
		left: 0;
		right: 0;
		width: auto;
		transform-origin: 50% 100%;
	}
}

/* ============================================================
 * 8. 降级：打印隐藏 / 减少动效
 * ============================================================ */
@media print {
	.izc-launcher {
		display: none !important;
	}
}
@media (prefers-reduced-motion: reduce) {
	.izc-panel,
	.izc-frame,
	.izc-loading,
	.izc-launcher .izc-fab,
	.izc-fab-ico,
	.izc-fab-ico-x,
	.izc-tip,
	.izc-fab-dot {
		transition: none !important;
	}
	.izc-panel {
		transform: none;
	}
	.izc-fab-wrap,
	.izc-fab-dot::after,
	.izc-sk::after,
	.izc-badge.is-on,
	.izc-loading-text::before {
		animation: none !important;
	}
}
