/**
 * 全站前台 · 下拉选择框（赛博玻璃）
 * 原生 select 美化 + 自定义增强面板（.lx-sel）
 */
:root {
	--lx-sel-bg: linear-gradient(155deg, rgba(10, 16, 32, 0.96) 0%, rgba(12, 20, 40, 0.92) 55%, rgba(18, 14, 36, 0.96) 100%);
	--lx-sel-bg-solid: #0a101e;
	--lx-sel-border: rgba(103, 232, 249, 0.32);
	--lx-sel-border-hot: rgba(167, 139, 250, 0.55);
	--lx-sel-text: #e8f4ff;
	--lx-sel-muted: #8aa0b8;
	--lx-sel-accent: #67e8f9;
	--lx-sel-accent-2: #c4b5fd;
	--lx-sel-glow: 0 0 0 3px rgba(103, 232, 249, 0.14), 0 8px 28px rgba(0, 0, 0, 0.35);
	--lx-sel-radius: 12px;
	--lx-sel-h: 42px;
	--lx-sel-font: 14px;
}

/* ========== 原生 select 全局（前台） ========== */
body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native),
body:not(.wp-admin) select.lx-select,
body:not(.wp-admin) select.lx-fa-select,
body:not(.wp-admin) select.lx-sh-input,
body:not(.wp-admin) select.lx-rt-select,
body:not(.wp-admin) select.lx-rh-select,
body:not(.wp-admin) select.lx-swf-case-select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	min-height: var(--lx-sel-h);
	height: auto;
	padding: 0.55em 2.6em 0.55em 0.95em !important;
	font-size: var(--lx-sel-font) !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: var(--lx-sel-text) !important;
	background-color: var(--lx-sel-bg-solid) !important;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 6L8 10.5L12.5 6' stroke='%2367e8f9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
		linear-gradient(155deg, rgba(14, 22, 42, 0.98) 0%, rgba(16, 18, 40, 0.95) 50%, rgba(22, 14, 42, 0.98) 100%) !important;
	background-repeat: no-repeat !important;
	background-position: right 0.85em center, 0 0 !important;
	background-size: 14px 14px, 100% 100% !important;
	border: 1px solid var(--lx-sel-border) !important;
	border-radius: var(--lx-sel-radius) !important;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.05),
		inset 0 0 18px rgba(103, 232, 249, 0.04),
		0 4px 16px rgba(0, 0, 0, 0.22) !important;
	cursor: pointer !important;
	transition:
		border-color 0.22s ease,
		box-shadow 0.22s ease,
		transform 0.15s ease,
		background 0.22s ease,
		color 0.2s ease !important;
	outline: none !important;
	max-width: 100%;
	vertical-align: middle;
}

body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native):hover,
body:not(.wp-admin) select.lx-select:hover,
body:not(.wp-admin) select.lx-fa-select:hover,
body:not(.wp-admin) select.lx-sh-input:hover {
	border-color: rgba(103, 232, 249, 0.55) !important;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.06),
		0 0 0 1px rgba(103, 232, 249, 0.12),
		0 6px 20px rgba(0, 0, 0, 0.28) !important;
	color: #f0fbff !important;
}

body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native):focus,
body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native):focus-visible,
body:not(.wp-admin) select.lx-select:focus,
body:not(.wp-admin) select.lx-fa-select:focus {
	border-color: var(--lx-sel-accent) !important;
	box-shadow: var(--lx-sel-glow) !important;
	color: #fff !important;
}

body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native):disabled,
body:not(.wp-admin) select.lx-select:disabled {
	opacity: 0.55 !important;
	cursor: not-allowed !important;
	filter: grayscale(0.2);
}

body:not(.wp-admin) select:not([multiple]):not([size]):not(.lx-sel--raw):not(.lx-sel__native)::-ms-expand {
	display: none;
}

/* option 列表（Chrome/Edge 部分支持） */
body:not(.wp-admin) select:not(.lx-sel__native) option,
body:not(.wp-admin) select:not(.lx-sel__native) optgroup {
	background: #0c1220;
	color: #e8f4ff;
	font-weight: 500;
	padding: 8px 10px;
}
body:not(.wp-admin) select:not(.lx-sel__native) option:checked,
body:not(.wp-admin) select:not(.lx-sel__native) option:hover {
	background: linear-gradient(90deg, rgba(14, 116, 144, 0.55), rgba(91, 33, 182, 0.4));
	color: #fff;
}
body:not(.wp-admin) select:not(.lx-sel__native) optgroup {
	font-weight: 700;
	color: var(--lx-sel-accent);
	font-style: normal;
}

/* ========== 自定义增强壳 ========== */
.lx-sel {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	max-width: 100%;
	min-width: 0;
	width: auto;
	font-family: inherit;
	--lx-sel-local-w: 100%;
}
/* 块级表单里占满 */
label .lx-sel,
.lx-de__form .lx-sel,
.form-table .lx-sel,
.lx-cm-field .lx-sel,
.lx-dash-field .lx-sel,
p .lx-sel,
.lx-sel--block {
	display: flex;
	width: 100%;
}
.lx-sel.is-open {
	z-index: 80;
}

/* 隐藏原生，保留表单提交 */
.lx-sel__native {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	appearance: none !important;
	background: none !important;
	box-shadow: none !important;
}

.lx-sel__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-width: 7.5em;
	min-height: var(--lx-sel-h);
	padding: 0.5em 0.85em 0.5em 0.95em;
	margin: 0;
	border: 1px solid var(--lx-sel-border);
	border-radius: var(--lx-sel-radius);
	background: var(--lx-sel-bg);
	color: var(--lx-sel-text);
	font-size: var(--lx-sel-font);
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.05),
		inset 0 0 20px rgba(103, 232, 249, 0.04),
		0 4px 16px rgba(0, 0, 0, 0.22);
	transition:
		border-color 0.22s ease,
		box-shadow 0.22s ease,
		transform 0.15s ease,
		background 0.22s ease;
	outline: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.lx-sel__trigger:hover {
	border-color: rgba(103, 232, 249, 0.55);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.06),
		0 0 0 1px rgba(103, 232, 249, 0.1),
		0 8px 22px rgba(0, 0, 0, 0.28);
}
.lx-sel.is-open .lx-sel__trigger,
.lx-sel__trigger:focus-visible {
	border-color: var(--lx-sel-accent);
	box-shadow: var(--lx-sel-glow);
}
.lx-sel.is-disabled .lx-sel__trigger {
	opacity: 0.55;
	cursor: not-allowed;
	filter: grayscale(0.15);
}
.lx-sel__value {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	letter-spacing: 0.01em;
}
.lx-sel__value.is-placeholder {
	color: var(--lx-sel-muted);
	font-weight: 500;
}
.lx-sel__chev {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 7px;
	background: rgba(103, 232, 249, 0.1);
	border: 1px solid rgba(103, 232, 249, 0.22);
	color: var(--lx-sel-accent);
	transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}
.lx-sel__chev svg {
	width: 12px;
	height: 12px;
	display: block;
}
.lx-sel.is-open .lx-sel__chev {
	transform: rotate(180deg);
	background: rgba(196, 181, 253, 0.14);
	border-color: rgba(196, 181, 253, 0.4);
	color: var(--lx-sel-accent-2);
}

/* 展开面板 */
.lx-sel__panel {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 120;
	margin: 0;
	padding: 6px;
	list-style: none;
	max-height: min(280px, 48vh);
	overflow-y: auto;
	overflow-x: hidden;
	border-radius: 14px;
	border: 1px solid rgba(103, 232, 249, 0.28);
	background:
		linear-gradient(180deg, rgba(14, 20, 40, 0.98), rgba(8, 12, 24, 0.98));
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.35) inset,
		0 16px 40px rgba(0, 0, 0, 0.45),
		0 0 30px rgba(103, 232, 249, 0.08);
	transform-origin: top center;
	animation: lx-sel-panel-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
	scrollbar-width: thin;
	scrollbar-color: rgba(103, 232, 249, 0.35) transparent;
}
.lx-sel__panel[hidden] {
	display: none !important;
}
.lx-sel.is-drop-up .lx-sel__panel {
	top: auto;
	bottom: calc(100% + 6px);
	transform-origin: bottom center;
	animation-name: lx-sel-panel-in-up;
}
@keyframes lx-sel-panel-in {
	from {
		opacity: 0;
		transform: translateY(-8px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}
@keyframes lx-sel-panel-in-up {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.lx-sel__opt {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	margin: 2px 0;
	border-radius: 9px;
	color: var(--lx-sel-text);
	font-size: 13.5px;
	font-weight: 560;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
	line-height: 1.35;
	word-break: break-word;
}
.lx-sel__opt:hover,
.lx-sel__opt.is-active {
	background: linear-gradient(90deg, rgba(14, 116, 144, 0.28), rgba(91, 33, 182, 0.22));
	color: #fff;
}
.lx-sel__opt.is-selected {
	background: linear-gradient(90deg, rgba(14, 116, 144, 0.42), rgba(91, 33, 182, 0.32));
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.22);
}
.lx-sel__opt.is-selected::after {
	content: "";
	margin-left: auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, #a5f3fc, #67e8f9 50%, #5b21b6);
	box-shadow: 0 0 8px rgba(103, 232, 249, 0.55);
	flex: 0 0 auto;
}
.lx-sel__opt[aria-disabled="true"],
.lx-sel__opt.is-disabled {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}
.lx-sel__group {
	padding: 8px 12px 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lx-sel-accent);
	opacity: 0.85;
}

/* 浅色页面 / 文章区可读性 */
body.single .lx-sel__trigger,
body.lx-archive-page .lx-sel__trigger {
	/* 仍用暗玻璃，保证对比 */
	background: linear-gradient(155deg, rgba(8, 12, 24, 0.96), rgba(14, 18, 36, 0.94));
}

/* 紧凑尺寸 */
.lx-sel--sm .lx-sel__trigger,
body:not(.wp-admin) select.lx-sel--sm-native {
	min-height: 34px;
	font-size: 13px !important;
	padding-top: 0.35em;
	padding-bottom: 0.35em;
	border-radius: 10px;
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
	.lx-sel__panel,
	.lx-sel.is-drop-up .lx-sel__panel {
		animation: none;
	}
	.lx-sel__chev,
	.lx-sel__trigger,
	body:not(.wp-admin) select {
		transition: none !important;
	}
}

/* 滚动条美化（WebKit） */
.lx-sel__panel::-webkit-scrollbar {
	width: 8px;
}
.lx-sel__panel::-webkit-scrollbar-thumb {
	background: rgba(103, 232, 249, 0.28);
	border-radius: 999px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
.lx-sel__panel::-webkit-scrollbar-track {
	background: transparent;
}
