@charset "utf-8";

/**
 * 右下角"咨询浮标"(WhatsApp) —— 按目标站 www.gx-game.com 的 Chaty 浮标一比一复刻
 *
 * 所有数值都是从目标站的**计算样式**上量下来的(不是抄插件的 CSS 文件), 见
 * runtime/_ref/gxgame/chaty-front.min.css(参考) 与 runtime/_diff/widgetdiff.js(验收)。
 * 两处 `主题外溢` 的数值特意保留, 因为它们决定了目标站的**实际渲染**:
 *   - 输入框 `margin-bottom: 14px`
 *   - 发送键 `margin: 0 15.52px 15.52px 0`  → 因为右边距把一行占满, 按钮**换行到了第二行**
 *     (目标站的按钮就在输入框下面一行, 不是并排)。想让按钮回到输入框右侧并排:
 *     把 `.consult-submit` 的 `margin-right` 改成 0 即可。
 */

/* ---------- 浮标本体 ---------- */

.consult-widget {
	position: fixed;
	z-index: 9999;
	transition: 0.25s linear;
	/* 目标站整个浮标的行高是 1.6(实测面板 16px/25.6px、气泡 14px/22.4px), 从根上继承 */
	line-height: 1.6;
}

.consult-widget *,
.consult-popup * {
	box-sizing: border-box;
}

.consult-trigger {
	cursor: pointer;
	position: relative;
}

.consult-link {
	display: block;
	line-height: 0;
	color: inherit;
	text-decoration: none;
}

/* 图标容器: 54x54 + 4px 外边距 => 外层正好 62x62(与目标站一致) */
.consult-anim {
	position: relative;
	width: 54px;
	height: 54px;
	margin: 4px;
	border-radius: 50%;
}

.consult-ico {
	cursor: pointer;
	width: 100%;
	height: 100%;
	display: block;
	position: relative;
	border-radius: 50%;
	box-shadow: 0 3px 6px rgba(0, 0, 0, .25);
}

/* hover 时压一层 12% 黑, 与原站一致 */
.consult-anim:after {
	content: "";
	position: absolute;
	height: 100%;
	width: 100%;
	top: 0;
	left: 0;
	background: #000;
	z-index: 111;
	display: block;
	border-radius: 50%;
	opacity: 0;
	transition: all .1s linear;
}

.consult-link:hover .consult-anim:after {
	opacity: .12;
}

/* 无障碍: 只给读屏用的文字 */
.consult-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- 对话面板 ---------- */

.consult-popup {
	vertical-align: bottom;
	background: #fff;
	border-radius: 6px;
	position: fixed;
	padding: 0;
	z-index: 100001;
	width: 280px;
	transition: all .5s linear;
	box-shadow: rgba(0, 0, 0, .16) 0 5px 40px;
	/* 与 .consult-widget 同源: 面板是它的兄弟节点, 行高要各自声明 */
	line-height: 1.6;
}

/* 收起态: 原站是把它推到屏幕外(bottom:-100%), 而不是 display:none */
.consult-popup:not(.is-open) {
	bottom: -100% !important;
	/**
	 * 只靠 bottom:-100% 在**整页截图**里会漏出来: 那种截图会把视口撑成整篇文档高,
	 * -100% 的基准跟着变成整篇文档, 面板就落进了可见区域(实测通利首页整页比对多出
	 * 115988px ≈ 面板 280x430)。补一层 opacity/pointer-events 彻底不绘制。
	 * 展开时这条规则失效, 所以动画不受影响(transition: all 会同时过渡 opacity)。
	 */
	opacity: 0;
	pointer-events: none;
}

.consult-body {
	background: #e6ddd4;
	padding: 20px 20px 20px 10px;
	position: relative;
	z-index: 2;
	height: 260px;
}

/* 涂鸦水印: 原站用一张 550x999 的 PNG, opacity .08 平铺 */
.consult-has-doodle .consult-body:before {
	content: "";
	display: block;
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 100%;
	z-index: 0;
	opacity: .08;
	background-image: var(--consult-doodle, url(./doodle.svg));
	background-repeat: repeat;
}

.consult-close {
	position: absolute;
	right: 5px;
	top: 5px;
	background: #30534b;
	width: 22px;
	height: 22px;
	border-radius: 15px;
	padding: 3px;
	cursor: pointer;
	transition: all .4s;
	z-index: 3;
}

.consult-close:hover {
	transform: rotate(180deg);
}

.consult-close-x {
	position: relative;
	display: block;
	width: 16px;
	height: 16px;
	transition: all .4s;
}

.consult-close-x:before,
.consult-close-x:after {
	content: "";
	position: absolute;
	width: 12px;
	height: 2px;
	background-color: #fff;
	display: block;
	border-radius: 2px;
	top: 7px;
	left: 2px;
}

.consult-close-x:before {
	transform: rotate(45deg);
}

.consult-close-x:after {
	transform: rotate(-45deg);
}

.consult-msg {
	padding: 7px 14px 6px;
	background-color: #fff;
	border-radius: 0 8px 8px;
	position: relative;
	transform-origin: center top;
	z-index: 2;
	box-shadow: rgba(0, 0, 0, .13) 0 1px .5px;
	margin: 4px 0 0 15px;
	max-width: calc(100% - 40px);
	font-size: 14px;
	font-family: Segoe UI, Helvetica Neue, Helvetica, Lucida Grande, Arial, Ubuntu, Cantarell, Fira Sans, sans-serif;
}

.consult-msg p {
	margin: 0;
	padding: 0;
	color: #303030;
}

.consult-footer {
	position: relative;
	padding: 12px 15px;
	background: #f0f0f0;
	/**
	 * 高度钉住 170px: 目标站底栏实测就是 170(对话区 260 + 底栏 170 = 面板 430)。
	 * 里面除了"输入框行 62 + 发送键行 63.52"之外还剩 ~20.5px 空白, 那部分是目标站**主题样式
	 * 外溢**带来的(从插件 CSS 推不出来), 所以这里直接钉高度对齐几何, 而不是猜一个 margin。
	 */
	height: 170px;
}

.consult-field {
	width: calc(100% - 60px);
	float: left;
}

.consult-msg-input {
	height: 48px;
	line-height: 32px;
	padding: 0 10px 0 15px;
	font-size: 14px;
	resize: none;
	width: 100%;
	border: none;
	border-radius: 24px;
	outline: 0;
	/* 原站这里被主题样式带出了 14px 下边距(字段区因此高 62px) */
	margin: 0 0 14px 0;
	font-family: Segoe UI, Helvetica Neue, Helvetica, Lucida Grande, Arial, Ubuntu, Cantarell, Fira Sans, sans-serif;
}

.consult-msg-input:focus {
	outline: 0;
	box-shadow: none;
}

.consult-submit {
	line-height: 48px;
	text-align: center;
	float: right;
	height: 48px;
	width: 48px;
	padding: 8px 10px 8px 15px;
	background: #25d366;
	border-radius: 24px;
	outline: 0;
	box-shadow: none;
	border: none;
	cursor: pointer;
	/* 原站的 15.52px = 主题给 button 的 1em 外边距; 右边距把一行占满 => 按钮换到第二行 */
	margin: 0 15.52px 15.52px 0;
}

.consult-submit:hover,
.consult-submit:focus {
	background: #22bf5b;
}

.consult-submit svg {
	width: 100%;
	height: 100%;
	display: block;
}
