/* share-modal.css */
html.kc-share-scroll-locked,
body.kc-share-scroll-locked {
	overflow: hidden !important;
	overscroll-behavior: none;
}

.kc-share-component,
.kc-share-component *,
.kc-share-component *::before,
.kc-share-component *::after {
	box-sizing: border-box;
}

.kc-share-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	margin: 0;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--theme-color-primary);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	cursor: pointer;
}

.kc-share-trigger-icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
}

.kc-share-trigger-icon svg {
	width: 100%;
	height: 100%;
}

/* 全站自動輸出的實例只保留 Popup，本身不顯示原始 Trigger */
.kc-share-global-source
> .kc-share-component
> .kc-share-trigger {
	display: none !important;
}

.kc-share-modal {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483647 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100svh;
	padding: 24px;
	isolation: isolate;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease;
}

.kc-share-modal[hidden] {
	display: none !important;
}

.kc-share-modal.is-open {
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
}

.kc-share-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: rgba(0, 0, 0, 0.85);
}

.kc-share-dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 450px);
	max-height: calc(100svh - 48px);
	overflow: hidden;
	border-radius: 18px;
	background: var(--theme-color-surface);
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
	transform: translateY(18px) scale(0.98);
	opacity: 0;
	transition:
		transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.25s ease;
}

.kc-share-modal.is-open .kc-share-dialog {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.kc-share-dialog-scroll {
	max-height: calc(100svh - 48px);
	padding: 28px 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

@media (min-width: 700px) {
    .kc-share-dialog-scroll {
        padding: 36px 32px 40px 32px;
    }
}

.kc-share-drawer-handle-area {
	display: none;
}

.kc-share-popup {
	--kc-share-primary: var(--theme-color-primary);
    --kc-share-primary-hover: var(--theme-color-primary-hover);
    --kc-share-text: var(--theme-color-text);
    --kc-share-muted: color-mix(in srgb, var(--theme-color-text) 62%, transparent);
    --kc-share-surface: var(--theme-color-surface);
    --kc-share-surface-muted: var(--theme-color-surface-muted);
    --kc-share-border: var(--theme-color-border);

	width: 100%;
	color: var(--kc-share-text);
	font-family: inherit;
}

.kc-share-popup button,
.kc-share-popup a {
	font: inherit;
	-webkit-tap-highlight-color: transparent;
}

.kc-share-popup svg {
	display: block;
}

.kc-share-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 20px;
	margin-bottom: 22px;
}

.kc-share-title {
	margin: 0;
	color: var(--kc-share-text);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.35;
	letter-spacing: -0.035em;
}

.kc-share-close {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 38px !important;
	height: 38px !important;
	margin: 0 !important;
	padding: 8px !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--kc-share-surface-muted) !important;
	color: var(--kc-share-text) !important;
	box-shadow: none !important;
	cursor: pointer;
}

.kc-share-close svg {
	width: 22px;
	height: 22px;
}

.kc-share-tabs {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 6px !important;
	width: 100% !important;
	margin: 0 0 22px !important;
	padding: 8px !important;
	border-radius: 10px !important;
	background: var(--kc-share-surface-muted) !important;
	box-shadow: none !important;
}

.kc-share-tab {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	min-height: 46px !important;
	margin: 0 !important;
	padding: 9px 12px !important;
	border: 0 !important;
	border-radius: 7px !important;
	background: transparent !important;
	color: var(--theme-color-text) !important;
	font-size: 15px !important;
	font-weight: 650 !important;
	line-height: 1.4 !important;
	text-transform: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	box-shadow: none !important;
	cursor: pointer !important;
	pointer-events: auto !important;
	position: relative;
	z-index: 3;
	transition:
		background-color 0.28s ease,
		color 0.28s ease,
		transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.kc-share-tab.is-active {
	background: var(--theme-color-primary) !important;
	color: #000 !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.kc-share-tab:active {
	transform: scale(0.985);
}

.kc-share-tab svg {
	width: 19px !important;
	height: 19px !important;
	color: inherit;
}

.kc-share-panels,
.kc-share-panel,
.kc-share-panel-inner {
	width: 100%;
}

.kc-share-panels {
	position: relative;
	overflow: hidden;
	display: grid;
}

.kc-share-panel {
	grid-area: 1 / 1;
	z-index: 1;
	display: block;
	margin: 0;
	padding: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(14px);
	will-change: opacity, transform;
	transition:
		opacity 0.24s ease,
		transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0s linear 0.34s;
}

.kc-share-panel[hidden] {
	display: block !important;
}

.kc-share-panel.is-active {
	z-index: 2;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition-delay: 0s;
}

@media (max-width: 560px) {
	.kc-share-modal {
		align-items: flex-end;
		padding: 0;
	}

	.kc-share-dialog {
		width: 100%;
		max-width: none;
		max-height: calc(100svh - 8px);
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
		opacity: 1;
	}

	.kc-share-modal.is-open .kc-share-dialog {
		transform: translateY(0);
	}

	.kc-share-dialog-scroll {
		max-height: calc(100svh - 8px);
		padding:
			8px
			20px
			calc(22px + env(safe-area-inset-bottom));
	}

	.kc-share-drawer-handle-area {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 28px;
		touch-action: none;
	}

	.kc-share-drawer-handle {
		width: 42px;
		height: 5px;
		border-radius: 999px;
		background: var(--theme-color-border, #b8b8b8);
	}

	.kc-share-title {
		font-size: 26px;
	}

	.kc-share-tabs {
		margin-bottom: 16px !important;
		padding: 7px !important;
	}

	.kc-share-tab {
		min-height: 42px !important;
		padding: 7px !important;
		font-size: 14px !important;
	}
}

.kc-share-social-layout {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 25px;
}

.kc-share-social-preview {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--kc-share-border);
	border-radius: 15px;
	background: var(--kc-share-surface);
	color: inherit;
	text-align: left;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	cursor: pointer;
}


.kc-share-preview-media {
	width: 100%;
	aspect-ratio: 1.91 / 1;
	overflow: hidden;
	background: var(--kc-share-surface-muted);
}

.kc-share-preview-media img,
.kc-share-preview-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kc-share-preview-body {
	padding: 16px 18px 22px;
}

.kc-share-preview-site {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 11px;
}

.kc-share-preview-favicon-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	padding: 5px;
	border-radius: 8px;
	background: var(--kc-share-surface-muted);
}

.kc-share-preview-favicon {
	display: block;
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.kc-share-preview-site-name {
	min-width: 0;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kc-share-preview-title {
	display: -webkit-box;
	max-height: calc(1.38em * 2);
	margin: 0;
	overflow: hidden;
	color: var(--kc-share-text);
	font-size: 23px;
	font-weight: 700;
	line-height: 1.38;
	letter-spacing: -0.025em;
	text-overflow: ellipsis;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.kc-share-social-list {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	align-items: start;
	gap: 8px;
	width: 100%;
}

.kc-share-social-item {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--kc-share-text) !important;
	text-align: center;
	text-decoration: none !important;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none !important;
	cursor: pointer;
}

.kc-share-social-item[hidden] {
	display: none !important;
}

.kc-share-social-item .kc-share-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	padding: 11px;
	border-radius: 10px;
	background: var(--kc-share-surface-muted);
	color: var(--theme-color-text);
}

.kc-share-social-item:hover .kc-share-icon,
a.kc-share-social-item:hover .kc-share-icon,
button.kc-share-social-item:hover .kc-share-icon {
	background: var(--kc-share-primary) !important;
	color: #000 !important;
}

@media (min-width: 1000px) {
	.kc-share-social-item[data-network="twitter"] {
		display: none !important;
	}
	.kc-share-social-list {
		grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
	}
}

.kc-share-social-item {
    --kc-share-social-icon-size: 38px;
}

.kc-share-social-item svg {
	width: var(--kc-share-social-icon-size) !important;
	height: var(--kc-share-social-icon-size) !important;
	max-width: none !important;
	max-height: none !important;
}

.kc-share-social-item svg path {
	fill: currentColor !important;
	color: inherit;
}

.kc-share-social-label {
	display: block;
	width: 100%;
	overflow: hidden;
	font-size: 10.5px;
	font-weight: 600;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kc-share-copy-state {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.kc-share-copy-state svg {
	width: 24px;
	height: 24px;
}

.kc-share-copy-state-check {
	display: none;
}

.kc-share-copy-item.is-copied
.kc-share-copy-state-copy {
	display: none;
}

.kc-share-copy-item.is-copied
.kc-share-copy-state-check {
	display: inline-flex;
}

.kc-share-panel[data-share-panel="qr"]
.kc-share-panel-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.kc-share-qr-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 28px;
	width: 100%;
	text-align: center;
}

.kc-share-qr-box {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: var(--theme-radius-medium, 8px);
	background: transparent;
	box-shadow: none;
	overflow: hidden;
}

.kc-share-qr-primary {
	display: flex;
	align-items: center;
	justify-content: center;
}

.kc-share-qr-code,
.kc-share-qr-image,
.kc-share-qr-primary img,
.kc-share-qr-code svg,
.kc-share-qr-code canvas {
	display: block;
	width: 200px !important;
	height: 200px !important;
	max-width: 100% !important;
	box-shadow: none !important;
	border-radius: var(--theme-radius-medium, 8px);
}

.kc-share-qr-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.kc-share-qr-title {
	margin: 0;
	font-size: 23px;
	font-weight: 600;
	line-height: 1.45;
}

.kc-share-qr-description {
	max-width: 350px;
	margin: 0;
	color: var(--kc-share-muted);
	font-size: 14.5px;
	line-height: 1.7;
}

@media (max-width: 560px) {

	.kc-share-social-layout {
		gap: 19px;
	}

	.kc-share-preview-body {
		padding: 13px 14px 19px;
	}

	.kc-share-preview-title {
		font-size: 21px;
	}

	.kc-share-social-list {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 6px;
	}

	.kc-share-copy-item {
		order: 1;
	}

	.kc-share-social-item[data-network="facebook"] {
		order: 2;
	}

	.kc-share-social-item[data-network="twitter"] {
		display: none !important;
	}

	.kc-share-social-item[data-network="line"] {
		order: 3;
	}

	.kc-share-social-item[data-network="threads"] {
		order: 4;
	}

	.kc-share-social-more {
		order: 5;
	}

	.kc-share-social-item {
		gap: 6px;
	}

	.kc-share-social-item .kc-share-icon {
		padding: 7px;
	}

	.kc-share-social-item {
		--kc-share-social-icon-size: 32px;
	}

	.kc-share-social-label {
		font-size: 9.5px;
	}

	.kc-share-qr-content {
		gap: 24px;
	}

	.kc-share-qr-title {
		font-size: 22px;
	}

	.kc-share-qr-description {
		font-size: 14px;
	}

	.kc-share-qr-code,
	.kc-share-qr-image,
	.kc-share-qr-code svg,
	.kc-share-qr-code canvas {
		width: 100px !important;
		height: 100px !important;
	}
}

@media (prefers-reduced-motion: reduce) {

	.kc-share-tab,
	.kc-share-panel {
		transition: none !important;
	}
}

@media (max-width: 380px) {

	.kc-share-dialog-scroll {
		padding-right: 14px;
		padding-left: 14px;
	}

	.kc-share-title {
		font-size: 24px;
	}

	.kc-share-social-item .kc-share-icon {
		padding: 6px;
	}

	.kc-share-social-item {
		--kc-share-social-icon-size: 28px;
	}

	.kc-share-social-label {
		font-size: 9px;
	}
}
