/**
 * 前端样式
 */

.naibabiji-gch {
	margin: 1em 0;
}

.naibabiji-gch-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.naibabiji-gch-item {
	margin: 0;
	padding: 0;
	position: relative;
	width: fit-content;
}

.naibabiji-gch-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.5em 1em;
	text-decoration: none;
	color: inherit;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.naibabiji-gch-link:hover {
	transform: translateY(-2px);
}

.naibabiji-gch-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5em;
	height: 1.5em;
	flex-shrink: 0;
}

.naibabiji-gch-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.naibabiji-gch-icon-custom {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.naibabiji-gch-label {
	font-size: 0.9em;
}

/* 布局样式 */
.naibabiji-gch-layout-list .naibabiji-gch-list {
	flex-direction: column;
}

.naibabiji-gch-layout-inline .naibabiji-gch-list {
	flex-direction: row;
}

.naibabiji-gch-layout-icons .naibabiji-gch-label {
	display: none;
}

/* 浮动栏中启用标签时显示标签 */
.naibabiji-gch-floating-bar .naibabiji-gch-layout-icons:not(.naibabiji-gch-no-label) .naibabiji-gch-label {
	display: inline;
}

/* 尺寸 */
.naibabiji-gch-size-sm .naibabiji-gch-icon {
	width: 1em;
	height: 1em;
}

.naibabiji-gch-size-md .naibabiji-gch-icon {
	width: 1.5em;
	height: 1.5em;
}

.naibabiji-gch-size-lg .naibabiji-gch-icon {
	width: 2em;
	height: 2em;
}

/* 弹层 */
.naibabiji-gch-popover {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-0.5em);
	margin-bottom: 0.5em;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	pointer-events: none;
	z-index: 1000;
}

.naibabiji-gch-item:hover .naibabiji-gch-popover,
.naibabiji-gch-item.active .naibabiji-gch-popover {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.naibabiji-gch-popover-content {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 1em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	min-width: 150px;
	text-align: center;
}

.naibabiji-gch-popover-content::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #fff;
}

.naibabiji-gch-popover-value {
	margin-top: 0.5em;
	margin-bottom: 0;
	font-weight: 600;
	font-size: 0.9em;
}

.naibabiji-gch-qr-code {
	max-width: 200px;
	height: auto;
	margin-bottom: 0;
}

/* 浮动联系栏 */
.naibabiji-gch-floating-bar {
	position: fixed;
	right: 10px;
	bottom: 20px;
	z-index: 9999;
}

.naibabiji-gch-floating-bar.desktop {
	top: 50%;
	transform: translateY(-50%);
	bottom: auto;
}

.naibabiji-gch-floating-bar.mobile {
	right: 15px;
	bottom: 15px;
}

.naibabiji-gch-floating-bar .naibabiji-gch-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

/* 浮动栏中：弹层在左侧显示 */
.naibabiji-gch-floating-bar .naibabiji-gch-popover {
	bottom: auto;
	top: 50%;
	right: 100%;
	left: auto;
	transform: translateY(-50%) translateX(-0.5em);
	margin-bottom: 0;
	margin-right: 0.5em;
}

.naibabiji-gch-floating-bar .naibabiji-gch-item:hover .naibabiji-gch-popover,
.naibabiji-gch-floating-bar .naibabiji-gch-item.active .naibabiji-gch-popover {
	transform: translateY(-50%) translateX(0);
}

/* 浮动栏中弹层的箭头指向右侧 */
.naibabiji-gch-floating-bar .naibabiji-gch-popover-content::after {
	top: 50%;
	right: -12px;
	left: auto;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-left-color: #fff;
	border-top-color: transparent;
}

.naibabiji-gch-floating-bar.mobile .naibabiji-gch-list {
	position: absolute;
	right: 0;
	bottom: 60px;
	opacity: 0;
	visibility: hidden;
	transform: translateX(100%);
	transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.naibabiji-gch-floating-bar.mobile.expanded .naibabiji-gch-list {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}


.naibabiji-gch-floating-toggle {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #0073aa; /* 默认颜色，如果后台设置了图标颜色会被覆盖 */
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.naibabiji-gch-floating-toggle:hover {
	transform: scale(1.1);
}

.naibabiji-gch-floating-toggle svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

/* 响应式 */
@media (max-width: 768px) {
	.naibabiji-gch-floating-bar.desktop {
		display: none;
	}
}

@media (min-width: 769px) {
	.naibabiji-gch-floating-bar.mobile {
		display: none;
	}
}

