/* 右侧客服：白底胶囊，悬停特效参考 xinbodawood */
.side_contact {
	position: fixed;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.side_contact_list {
	list-style: none;
	margin: 0;
	padding: 12px 0;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	overflow: visible;
}

.side_contact_item {
	position: relative;
	width: 52px;
	height: 52px;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* 图标：默认棕字透明底，悬停白字棕圆 */
.side_contact_icon {
	position: relative;
	z-index: 4;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	color: #6b5344;
	font-size: 20px;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
	border-radius: 50%;
	transition: color 0.28s ease, background 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.side_contact_item:hover .side_contact_icon {
	background: #6b5344;
	color: #fff;
	transform: scale(1.05);
	box-shadow: 0 2px 10px rgba(107, 83, 68, 0.35);
}

.side_contact_whatsapp .side_contact_icon,
.side_contact_skype .side_contact_icon,
.side_contact_wechat .side_contact_icon {
	background: transparent;
	color: #6b5344;
}

.side_contact_whatsapp:hover .side_contact_icon,
.side_contact_skype:hover .side_contact_icon,
.side_contact_wechat:hover .side_contact_icon {
	background: #6b5344;
	color: #fff;
}

/* 置顶：胶囊外独立圆钮，默认隐藏，滚动后显示 */
.side_contact_top {
	display: none;
	margin-top: 12px;
	width: 44px;
	height: 44px;
}

.side_contact_top.is-visible {
	display: flex;
}

.side_contact_top .side_contact_icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #6b5344;
	color: #fff;
	font-size: 16px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	cursor: pointer;
}

.side_contact_top:hover .side_contact_icon {
	background: #3d2e24;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.side_contact_top .side_contact_panel {
	background: #6b5344;
}

.side_contact_top .side_contact_panel span {
	color: #fff;
	font-size: 13px;
}

/* 左侧棕色标签：完全在胶囊左侧滑出，不叠到图标上 */
.side_contact_panel {
	position: absolute;
	right: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(8px);
	height: 36px;
	display: flex;
	align-items: center;
	background: #6b5344;
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	padding: 0;
	border-radius: 4px;
	box-shadow: 0 4px 14px rgba(107, 83, 68, 0.28);
	transition: max-width 0.32s ease, opacity 0.28s ease, padding 0.32s ease, transform 0.32s ease;
	white-space: nowrap;
	pointer-events: none;
	z-index: 1;
}

.side_contact_item:hover .side_contact_panel {
	max-width: 320px;
	opacity: 1;
	padding: 0 14px;
	transform: translateY(-50%) translateX(0);
	pointer-events: auto;
}

.side_contact_panel a,
.side_contact_panel span {
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: opacity 0.2s;
}

.side_contact_panel a:hover {
	color: #fff;
	opacity: 0.88;
}

/* 微信二维码：固定宽度淡入，避免 max-width 动画出现细长白条 */
.side_contact_panel_qr {
	right: calc(100% + 10px);
	top: 50%;
	width: 180px;
	height: auto !important;
	min-height: 0;
	max-width: none !important;
	align-items: center;
	justify-content: center;
	background: #fff;
	border-radius: 8px;
	padding: 10px !important;
	opacity: 0;
	visibility: hidden;
	overflow: visible;
	transform: translateY(-50%) translateX(12px);
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
	z-index: 5;
	pointer-events: none;
}

.side_contact_item:hover .side_contact_panel_qr,
.side_contact_wechat:hover .side_contact_panel_qr {
	max-width: none !important;
	width: 180px;
	padding: 10px !important;
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
	pointer-events: auto;
}

.side_contact_panel_qr img {
	display: block !important;
	width: 160px !important;
	height: 160px !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: contain;
	border: 0;
}

/* 胶囊与图标不被面板裁切 */
.side_contact,
.side_contact_list,
.side_contact_item {
	overflow: visible;
}

/* 桌面端隐藏泡泡按钮（仅手机显示，功能不变） */
.side_contact_toggle {
	display: none;
}

@media only screen and (max-width: 768px) {
	.side_contact {
		top: auto;
		bottom: 85px;
		right: 0;
		transform: none;
	}

	.side_contact_toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 50px;
		height: 50px;
		padding: 0;
		border: none;
		border-radius: 50% 0 0 50%;
		background: #6b5344;
		color: #fff;
		font-size: 22px;
		cursor: pointer;
		box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.2);
		position: relative;
		z-index: 100001;
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
		pointer-events: auto;
	}

	.side_contact_toggle .side_contact_close {
		display: none;
		font-size: 20px;
		pointer-events: none;
	}

	.side_contact_toggle .fa-comments {
		pointer-events: none;
	}

	.side_contact.is-open .side_contact_toggle {
		background: #3d2e24;
	}

	.side_contact.is-open .side_contact_toggle .fa-comments {
		display: none;
	}

	.side_contact.is-open .side_contact_toggle .side_contact_close {
		display: block;
	}

	.side_contact_list {
		display: none;
		margin-bottom: 6px;
	}

	.side_contact.is-open .side_contact_list {
		display: block;
	}

	.side_contact_top,
	.side_contact_top.is-visible {
		display: none !important;
	}

	.side_contact_panel_qr img {
		width: 140px;
		height: 140px;
	}
}
