/* =========================================
   Floating UI (FAB & Back To Top)
========================================= */
.side-fab-group {
	position: fixed;
	right: 1.25rem;
	bottom: 1.875rem; 
	display: flex;
	flex-direction: column;
	gap: 1rem;
	z-index: 998;
	align-items: flex-end; 
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
	transition: all var(--duration-normal) ease;
}

.side-fab-group.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    display: flex;
    align-items: center;
    justify-content: flex-end; 
    width: 3rem; height: 3rem;
    padding: 0 0.75rem; 
    background: var(--color-gold); 
    color: var(--color-dark-teal);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.4);
    border-radius: 2rem; 
    cursor: pointer; border: none;
    overflow: hidden; white-space: nowrap;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color var(--duration-normal) ease;
}

.fab-item svg {
	width: 1.5rem;
	height: 1.5rem;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

.fab-item::before {
	content: attr(title);
	margin-right: 0.75rem;
	font-size: 0.95rem;
	font-weight: 600;
	opacity: 0;
	transform: translateX(10px);
	transition: all 0.3s ease;
}

.back-to-top {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- RWD --- */
@media (min-width: 48rem) {
	.fab-item:hover {
		width: 9rem;
		background-color: #ffe066;
	}

	.fab-item:hover::before {
		opacity: 1;
		transform: translateX(0);
		transition-delay: 0.1s;
	}

	/* BackToTop 不延展寬度 */
	.fab-item.back-to-top:hover {
		width: 3rem;
		background-color: #ffe066;
		transform: translateY(-4px);
	}

	.fab-item.back-to-top::before {
		display: none;
	}
}

@media (max-width: 48rem) {
	.fab-item {
		width: 2.75rem;
		height: 2.75rem;
		justify-content: center;
		padding: 0;
	}

	.fab-item::before {
		display: none;
	}

	.side-fab-group {
		bottom: 1.25rem;
		right: 0.9375rem;
	}
}
