.xya-fw__hp {
	position: absolute;
	left: -9999px;
	height: 0;
	overflow: hidden;
}

.xya-fw--float {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 100060;
	font-family: "Manrope", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
	pointer-events: none;
	-webkit-font-smoothing: antialiased;
}

.xya-fw--float .xya-fw__tog,
.xya-fw--float .xya-fw__panel {
	pointer-events: auto;
}

/* 已并入主题 xinmi-dock：隐藏独立按钮，对话窗贴在联系栏旁 */
.xya-fw--docked.xya-fw--float {
	right: auto;
	bottom: auto;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	overflow: visible;
	z-index: 100060;
}

.xya-fw--docked .xya-fw__tog {
	display: none !important;
}

.xya-fw__dock-btn {
	pointer-events: auto !important;
}

.xya-fw--float.is-dragged {
	right: auto;
	bottom: auto;
}

.xya-fw__tog {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 56px;
	height: 56px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: #1c1c1c;
	color: #fff;
	font-size: 14px;
	font-weight: 650;
	cursor: grab;
	touch-action: none;
	user-select: none;
	box-shadow: 0 12px 28px rgba(28, 28, 28, 0.28);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.xya-fw__tog:active {
	cursor: grabbing;
}

.xya-fw__tog:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 32px rgba(28, 28, 28, 0.36);
}

.xya-fw__tog.is-open {
	background: #2a2a2a;
}

.xya-fw__tog-ic {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ffb100;
	box-shadow: 0 0 0 3px rgba(255, 177, 0, 0.28);
}

.xya-fw__panel {
	display: none;
	flex-direction: column;
	width: min(380px, calc(100vw - 28px));
	height: min(540px, calc(100vh - 100px));
	background: #fafbfc;
	border: 1px solid rgba(28, 28, 28, 0.08);
	border-radius: 18px;
	overflow: hidden;
	box-shadow:
		0 1px 2px rgba(28, 28, 28, 0.04),
		0 18px 40px rgba(28, 28, 28, 0.16);
	transform-origin: bottom right;
	animation: xya-fw-in 0.22s ease;
}

.xya-fw__panel[data-open="1"] {
	display: flex;
}

@keyframes xya-fw-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.xya-fw--float:not(.xya-fw--docked) .xya-fw__panel {
	position: absolute;
	right: 0;
	bottom: 68px;
}

.xya-fw--docked .xya-fw__panel {
	position: fixed;
	right: max(5.5rem, calc(env(safe-area-inset-right, 0px) + 5.25rem));
	bottom: max(5.25rem, calc(env(safe-area-inset-bottom, 0px) + 5.25rem));
	z-index: 100060;
}

.xya-fw__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	background: #1c1c1c;
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.xya-fw__avatar {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	background: linear-gradient(145deg, #ffb100 0%, #ff9600 100%);
	color: #1c1c1c;
	box-shadow: 0 2px 8px rgba(255, 177, 0, 0.35);
}

.xya-fw__avatar svg {
	display: block;
}

.xya-fw__brand {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}

.xya-fw__brand strong {
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.01em;
	line-height: 1.25;
}

.xya-fw__brand span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.62);
	line-height: 1.3;
}

.xya-fw__live {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #3dd68c;
	box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.28);
	flex: 0 0 auto;
}

.xya-fw__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.78);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.xya-fw__close svg {
	display: block;
	width: 14px;
	height: 14px;
}

.xya-fw__close:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

.xya-fw__log {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 14px 12px 10px;
	background: #f4f6f8;
	scrollbar-width: thin;
	scrollbar-color: #cfd6de transparent;
}

.xya-fw__log::-webkit-scrollbar {
	width: 5px;
}

.xya-fw__log::-webkit-scrollbar-thumb {
	background: #cfd6de;
	border-radius: 999px;
}

.xya-fw__m {
	margin: 0 0 8px;
	padding: 9px 12px;
	border-radius: 14px;
	background: #fff;
	line-height: 1.5;
	font-size: 13.5px;
	color: #222;
	white-space: pre-wrap;
	word-break: break-word;
	box-shadow: 0 1px 2px rgba(28, 28, 28, 0.04);
	animation: xya-msg-in 0.18s ease;
}

@keyframes xya-msg-in {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.xya-fw__m--user {
	background: #1c1c1c;
	color: #fff;
	margin-left: 36px;
	border-bottom-right-radius: 4px;
	box-shadow: none;
}

.xya-fw__m--bot {
	margin-right: 24px;
	border: 1px solid #e8ecef;
	border-bottom-left-radius: 4px;
}

.xya-fw__m--sys {
	color: #8a8f98;
	font-size: 12px;
	background: transparent;
	box-shadow: none;
	padding: 2px 4px;
	text-align: center;
	animation: none;
}

.xya-fw__m--welcome {
	margin-right: 24px;
	border: 1px solid #e8ecef;
	border-bottom-left-radius: 4px;
	background: #fff;
	color: #222;
	font-size: 13.5px;
	line-height: 1.5;
	text-align: left;
	box-shadow: 0 1px 2px rgba(28, 28, 28, 0.04);
	padding: 9px 12px;
}

.xya-fw__m--think {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-right: 24px;
	padding: 9px 12px;
	border: 1px solid #e8ecef;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	background: #fff;
	color: #8a8f98;
	font-size: 12.5px;
	box-shadow: 0 1px 2px rgba(28, 28, 28, 0.04);
	text-align: left;
}

.xya-fw__dots {
	display: inline-flex;
	gap: 4px;
}

.xya-fw__dots i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #a8b0ba;
	animation: xya-dot 1.1s ease-in-out infinite;
}

.xya-fw__dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.xya-fw__dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes xya-dot {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-2px);
	}
}

.xya-fw__suggest {
	margin: 2px 0 8px;
}

.xya-fw__suggest-label {
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 650;
	color: #8a8f98;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.xya-fw__suggest-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.xya-fw__chip {
	max-width: 100%;
	margin: 0;
	padding: 7px 11px;
	border: 1px solid #e2e6ea;
	border-radius: 999px;
	background: #fff;
	color: #222;
	font-size: 12px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.xya-fw__chip:hover {
	border-color: #ffb100;
	background: #fff8eb;
	color: #1c1c1c;
}

.xya-fw__chip:active {
	background: #ffefd1;
}

.xya-fw__form {
	padding: 10px 12px 12px;
	border-top: 1px solid #e8ecef;
	background: #fff;
}

.xya-fw__composer {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 46px;
	padding: 5px 5px 5px 14px;
	border: 1px solid #e4e8ec;
	border-radius: 999px;
	background: #f7f8fa;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.xya-fw__composer:focus-within {
	border-color: #ffb100;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(255, 177, 0, 0.16);
}

.xya-fw__in {
	flex: 1;
	min-width: 0;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	color: #222;
	font-size: 13.5px;
	line-height: 34px;
	-webkit-appearance: none;
	appearance: none;
}

.xya-fw__in::placeholder {
	color: #9aa1aa;
}

.xya-fw__send {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ffb100 !important;
	color: #1c1c1c !important;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(255, 177, 0, 0.35);
	text-shadow: none;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.xya-fw__send svg {
	display: block;
}

.xya-fw__send:hover {
	background: #ff9600 !important;
	box-shadow: 0 2px 6px rgba(255, 150, 0, 0.4);
}

.xya-fw__send:active {
	transform: scale(0.96);
}

.xya-fw__send:disabled {
	opacity: 0.45;
	cursor: default;
	transform: none;
	box-shadow: none;
}

.xya-front--inline .xya-fw__panel {
	position: relative;
	width: 100%;
	height: 480px;
	margin: 0;
	box-shadow: none;
	pointer-events: auto;
	animation: none;
}

/* —— Mobile: bottom sheet —— */
@media (max-width: 640px) {
	.xya-fw--float:not(.xya-fw--docked) {
		right: 0;
		bottom: 0;
		left: 0;
	}

	.xya-fw--float:not(.xya-fw--docked) .xya-fw__panel,
	.xya-fw--docked .xya-fw__panel {
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: none;
		height: min(58vh, 460px);
		max-height: calc(100vh - 4.5rem - env(safe-area-inset-bottom, 0px));
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		transform-origin: bottom center;
		box-shadow: 0 -8px 32px rgba(28, 28, 28, 0.18);
		padding-bottom: env(safe-area-inset-bottom, 0px);
	}

	.xya-fw__head {
		gap: 8px;
		padding: 11px 10px 11px 12px;
		position: relative;
	}

	.xya-fw__head::before {
		content: "";
		position: absolute;
		top: 6px;
		left: 50%;
		width: 36px;
		height: 3px;
		margin-left: -18px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.22);
	}

	.xya-fw__avatar {
		width: 30px;
		height: 30px;
		border-radius: 8px;
	}

	.xya-fw__avatar svg {
		width: 15px;
		height: 15px;
	}

	.xya-fw__brand strong {
		font-size: 13px;
	}

	.xya-fw__brand span {
		font-size: 10.5px;
	}

	.xya-fw__close {
		width: 28px;
		height: 28px;
		border-radius: 7px;
	}

	.xya-fw__close svg {
		width: 13px;
		height: 13px;
	}

	.xya-fw__log {
		padding: 10px 10px 8px;
	}

	.xya-fw__m,
	.xya-fw__m--welcome,
	.xya-fw__m--think {
		margin-bottom: 7px;
		padding: 8px 10px;
		border-radius: 12px;
		font-size: 13px;
		line-height: 1.45;
	}

	.xya-fw__m--user {
		margin-left: 24px;
		border-bottom-right-radius: 4px;
	}

	.xya-fw__m--bot,
	.xya-fw__m--welcome,
	.xya-fw__m--think {
		margin-right: 14px;
		border-bottom-left-radius: 4px;
	}

	.xya-fw__suggest {
		margin: 0 0 6px;
	}

	.xya-fw__suggest-label {
		margin-bottom: 6px;
		font-size: 10px;
	}

	.xya-fw__chip {
		padding: 6px 10px;
		font-size: 11.5px;
	}

	.xya-fw__form {
		padding: 8px 10px 10px;
	}

	.xya-fw__composer {
		min-height: 42px;
		padding: 4px 4px 4px 12px;
	}

	.xya-fw__in {
		height: 32px;
		font-size: 13px;
		line-height: 32px;
	}

	.xya-fw__send {
		width: 34px;
		height: 34px;
		min-width: 34px;
	}

	.xya-fw__send svg {
		width: 15px;
		height: 15px;
	}

	.xya-front--inline .xya-fw__panel {
		height: min(58vh, 460px);
		max-width: none;
		width: 100%;
		border-radius: 16px;
		padding-bottom: 0;
	}
}
