/* TopRays AI 客服浮窗 */
.tr-chat,
.tr-chat * { box-sizing: border-box; }
.tr-chat { font-family: inherit; }

.tr-chat-fab {
	position: fixed; right: 22px; bottom: 22px; z-index: 9990;
	width: 58px; height: 58px; border-radius: 50%; border: 0;
	background: #1a66ff; color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 24px rgba(7, 26, 51, .28);
	transition: transform .15s;
}
.tr-chat-fab:hover { transform: translateY(-2px); }
.tr-chat-fab svg { width: 26px; height: 26px; }

.tr-chat-panel {
	position: fixed; right: 22px; bottom: 92px; z-index: 9990;
	width: 360px; max-width: calc(100vw - 32px);
	height: 520px; max-height: 70vh;
	background: #fff; border-radius: 12px; overflow: hidden;
	box-shadow: 0 18px 50px rgba(7, 26, 51, .3);
	display: flex; flex-direction: column;
}
.tr-chat-panel[hidden] { display: none; }

.tr-chat-head {
	background: #071a33; color: #fff; padding: 12px 14px;
	display: flex; align-items: center; gap: 10px; flex: none;
}
.tr-chat-ava {
	width: 34px; height: 34px; border-radius: 50%; flex: none;
	background: #1a66ff; color: #fff; font-size: 12px; font-weight: 700;
	letter-spacing: .5px; display: flex; align-items: center; justify-content: center;
}
.tr-chat-id b { display: block; font-size: 14px; line-height: 1.3; }
.tr-chat-id span { display: block; font-size: 11px; color: #8fa7c6; }
.tr-chat-close {
	margin-left: auto; background: none; border: 0; padding: 0 4px;
	color: #8fa7c6; font-size: 22px; line-height: 1; cursor: pointer;
}
.tr-chat-close:hover { color: #fff; }

.tr-chat-body {
	flex: 1; overflow-y: auto; padding: 14px;
	background: #f4f7fb; display: flex; flex-direction: column; gap: 10px;
}
.tr-chat-msg {
	max-width: 85%; padding: 9px 12px; border-radius: 10px;
	font-size: 13.5px; line-height: 1.6;
	white-space: pre-wrap; word-break: break-word;
}
.tr-chat-msg.user {
	align-self: flex-end; background: #1a66ff; color: #fff;
	border-bottom-right-radius: 3px;
}
.tr-chat-msg.bot {
	align-self: flex-start; background: #fff; color: #101f36;
	box-shadow: 0 1px 3px rgba(7, 26, 51, .12); border-bottom-left-radius: 3px;
}
.tr-chat-msg.typing { color: #5b6b84; font-style: italic; }

.tr-chat-form {
	display: flex; gap: 8px; align-items: flex-end; flex: none;
	padding: 10px 12px; background: #fff; border-top: 1px solid #e3e9f2;
}
.tr-chat-form textarea {
	flex: 1; resize: none; max-height: 90px; outline: none;
	border: 1px solid #ccd6e4; border-radius: 8px;
	padding: 8px 10px; font: inherit; font-size: 13.5px; color: #101f36;
}
.tr-chat-form textarea:focus { border-color: #1a66ff; }
.tr-chat-form button {
	flex: none; border: 0; border-radius: 8px; cursor: pointer;
	background: #1a66ff; color: #fff; padding: 9px 14px; font-size: 13.5px;
}
.tr-chat-form button:hover { background: #0f56e0; }
.tr-chat-form button:disabled { opacity: .6; cursor: default; }

.tr-chat-disc {
	flex: none; padding: 0 12px 10px; background: #fff;
	font-size: 11px; color: #8a97ab; text-align: center;
}

@media (max-width: 600px) {
	.tr-chat-fab { right: 16px; bottom: 16px; }
	.tr-chat-panel {
		right: 0; left: 0; bottom: 0; width: auto; max-width: none;
		height: 78vh; max-height: 78vh; border-radius: 14px 14px 0 0;
	}
}
