/* ==========================================================================
 * 悬浮联系组件（wdf = WangminDianZi Float）
 * 文件：/skin/css/contact-float.css
 * 版本：2026-10-28 重写，替代原 .suspension（原组件存在三个问题）
 * --------------------------------------------------------------------------
 * 为什么整组重写而不是改原 .suspension：
 *   ① 原样式在 @media(max-width:1199px) 与 (max-width:991px) 里写了
 *      .suspension{display:none} —— 手机与平板上组件**根本不存在**，
 *      无法在其上做任何按端交互。
 *   ② 原浮层只绑了 mouseenter（见 skin/js/customer.js），触屏设备没有 hover，
 *      点击无反应。
 *   ③ 原按钮固定 55px 宽、12px 单行不换行文字，系统字体放大或中文度量
 *      偏宽时「联系方式」会顶出按钮边界。
 *
 * 设计约定：
 *   · 类名一律 wdf__ 前缀，与原 .suspension 完全隔离，互不干扰；
 *   · 文字宽度自适应：按钮宽度随断点增长，字号随断点减小，且 nowrap + 裁剪兜底，
 *     任何字号下都不会溢出按钮；
 *   · 二维码容器固定 180×180、白底 + 细边框，图片 object-fit:contain，
 *     加载失败由 JS 切换 .is-fail 显示兜底文案，永远不出现空白灰块。
 * ========================================================================== */

/* ---------------------------------------------------------- 1. 悬浮按钮条 --- */
.wdf {
	position: fixed;
	right: 10px;
	bottom: 84px;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
	-webkit-tap-highlight-color: transparent;
}

.wdf__bar {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.wdf__btn {
	box-sizing: border-box;
	width: 56px;
	min-height: 52px;
	margin: 0;
	padding: 8px 3px 7px;
	border: 0;
	border-radius: 6px;
	background: #1f71c2;
	color: #fff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(20, 40, 80, .16);
	transition: background-color .18s, transform .18s;
}

.wdf__btn:hover,
.wdf__btn:focus-visible {
	background: #16b4b9;
	outline: none;
}

.wdf__btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(31, 113, 194, .35);
}

.wdf__btn:active {
	transform: scale(.96);
}

/* 图标 */
.wdf__ico {
	display: block;
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.wdf__ico svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* 文字：宽度绝不超出按钮 —— nowrap 定形，overflow 裁剪兜底 */
.wdf__txt {
	display: block;
	max-width: 100%;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	letter-spacing: -.2px;
}

/* 返回顶部：默认隐藏，滚动超过 400px 时由 JS 加 .wdf--scrolled 显示 */
.wdf__btn--top {
	display: none;
	min-height: 40px;
	padding: 8px 3px;
	background: #b9bfc9;
}

.wdf__btn--top:hover,
.wdf__btn--top:focus-visible {
	background: #a8aeb9;
}

.wdf--scrolled .wdf__btn--top {
	display: flex;
}

/* ------------------------------------------------------------- 2. 弹窗 --- */
.wdf-pop {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wdf-pop[hidden] {
	display: none;
}

.wdf-pop__mask {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, .5);
}

.wdf-pop__panel {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 340px;
	max-height: 86vh;
	overflow: auto;
	padding: 26px 22px 22px;
	background: #fff;
	border-radius: 14px;
	text-align: center;
	box-shadow: 0 18px 50px rgba(17, 24, 39, .28);
}

.wdf-pop__close {
	position: absolute;
	right: 6px;
	top: 4px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #9aa3af;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.wdf-pop__close:hover,
.wdf-pop__close:focus-visible {
	background: #f3f4f6;
	color: #374151;
	outline: none;
}

.wdf-pop__title {
	margin: 0 0 4px;
	font-size: 18px;
	line-height: 1.4;
	color: #111827;
}

.wdf-pop__sub {
	margin: 0 0 16px;
	font-size: 13px;
	color: #8b93a1;
}

/* 电话块 */
.wdf-pop__tel {
	margin: 0 0 18px;
	padding: 12px 14px;
	background: #f5f8fc;
	border-radius: 10px;
}

.wdf-pop__tel-label {
	display: block;
	font-size: 12px;
	color: #8b93a1;
}

.wdf-pop__tel a {
	display: inline-block;
	margin-top: 4px;
	font-family: Arial, "Microsoft YaHei", sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: #1f71c2;
	text-decoration: none;
	letter-spacing: .5px;
}

.wdf-pop__tel a:hover {
	text-decoration: underline;
}

/* 二维码：固定尺寸白底容器，杜绝「灰块」 */
.wdf-pop__qrbox {
	width: 180px;
	height: 180px;
	margin: 0 auto 10px;
	background: #fff;
	border: 1px solid #edf0f4;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.wdf-pop__qrbox img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* 图片加载失败时用它顶上，不留空白 */
.wdf-pop__fail {
	display: none;
	padding: 0 12px;
	font-size: 13px;
	line-height: 1.7;
	color: #b45309;
}

.wdf-pop__qrbox.is-fail img {
	display: none;
}

.wdf-pop__qrbox.is-fail .wdf-pop__fail {
	display: block;
}

.wdf-pop__hint {
	margin: 0;
	font-size: 13px;
	color: #5b6472;
}

.wdf-pop__qq {
	display: inline-block;
	margin-top: 16px;
	padding: 9px 22px;
	border-radius: 999px;
	background: #1f71c2;
	color: #fff;
	font-size: 14px;
	text-decoration: none;
}

.wdf-pop__qq:hover {
	background: #16b4b9;
}

/* 打开时锁滚动 */
body.wdf-lock {
	overflow: hidden;
}

/* -------------------------------------------------------- 3. 响应式 --- */
/* 平板 / 中等屏：字号降一档（按钮宽度保持 56，给「联系方式」留足余量） */
@media (max-width: 1199px) {
	.wdf {
		right: 8px;
		bottom: 76px;
	}

	.wdf__btn {
		min-height: 50px;
	}

	.wdf__txt {
		font-size: 11px;
	}
}

/* 手机：再降一档，触控区保持 ≥48px，并避开 iOS 底部安全区 */
@media (max-width: 640px) {
	.wdf {
		right: 6px;
		bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	}

	.wdf__bar {
		gap: 8px;
	}

	.wdf__btn {
		min-height: 52px;
		padding: 9px 3px 8px;
		border-radius: 8px;
	}

	.wdf__txt {
		font-size: 11px;
		letter-spacing: -.5px;
	}

	.wdf-pop {
		align-items: center;
		padding: 14px;
	}

	.wdf-pop__panel {
		max-width: 320px;
		padding: 24px 18px 20px;
	}

	.wdf-pop__qrbox {
		width: 168px;
		height: 168px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdf__btn {
		transition: none;
	}
}
