/* =========================================
   :root - MD3 颜色变量与基础设定
   ========================================= */
:root {
	/* --- MD3 蓝色主题 (浅色模式) --- */
	/* 主色 */
	--md-sys-color-primary: #36618E;
	--md-sys-color-on-primary: #FFFFFF;
	--md-sys-color-primary-container: #D1E4FF;
	--md-sys-color-on-primary-container: #1A4975;

	/* 次色 */
	--md-sys-color-secondary: #535F70;
	--md-sys-color-on-secondary: #FFFFFF;
	--md-sys-color-secondary-container: #D7E3F8;
	--md-sys-color-on-secondary-container: #3B4858;

	/* 第三色 */
	--md-sys-color-tertiary: #6B5778;
	--md-sys-color-on-tertiary: #FFFFFF;
	--md-sys-color-tertiary-container: #F3DAFF;
	--md-sys-color-on-tertiary-container: #523F5F;

	/* 错误色 */
	--md-sys-color-error: #BA1A1A;
	--md-sys-color-error-container: #FFDAD6;
	--md-sys-color-on-error-container: #93000A;

	/* 表面与背景 */
	--md-sys-color-background: #D1E4FF;
	--md-sys-color-on-background: #191C20;
	--md-sys-color-surface: #F8F9FF;
	--md-sys-color-on-surface: #191C20;

	/* 表面容器 (用于卡片、弹窗背景) */
	--md-sys-color-surface-container: #ECEEF4;
	--md-sys-color-surface-container-high: #E6E8EE;
	--md-sys-color-surface-container-highest: #E1E2E8;

	/* 变体 */
	--md-sys-color-surface-variant: #DFE2EB;
	--md-sys-color-on-surface-variant: #43474E;
	--md-sys-color-outline: #73777F;
	--md-sys-color-outline-variant: #C3C6CF;

	/* --- 基础设定 --- */
	--font-family: 'Product Sans', 'Noto Sans SC', sans-serif;
	--search-bar-width: 600px;
	--search-bar-height: 52px;
	--search-bar-radius: 26px;
	--card-radius: 24px;
	--ui-zoom-scale: 1;
}

[data-theme="dark"] {
	/* --- MD3 蓝色主题 (深色模式) --- */
	/* 主色 */
	--md-sys-color-primary: #A0CAFD;
	--md-sys-color-on-primary: #003258;
	--md-sys-color-primary-container: #1A4975;
	--md-sys-color-on-primary-container: #D1E4FF;

	/* 次色 */
	--md-sys-color-secondary: #BBC7DB;
	--md-sys-color-on-secondary: #253140;
	--md-sys-color-secondary-container: #3B4858;
	--md-sys-color-on-secondary-container: #D7E3F8;

	/* 第三色 */
	--md-sys-color-tertiary: #D7BEE4;
	--md-sys-color-on-tertiary: #3B2948;
	--md-sys-color-tertiary-container: #523F5F;
	--md-sys-color-on-tertiary-container: #F3DAFF;

	/* 错误色 */
	--md-sys-color-error: #FFB4AB;
	--md-sys-color-error-container: #93000A;
	--md-sys-color-on-error-container: #FFDAD6;

	/* 表面与背景 */
	--md-sys-color-background: #D1E4FF;
	--md-sys-color-on-background: #E1E2E8;
	--md-sys-color-surface: #111418;
	--md-sys-color-on-surface: #E1E2E8;

	/* 表面容器 */
	--md-sys-color-surface-container: #1D2024;
	--md-sys-color-surface-container-high: #272A2F;
	--md-sys-color-surface-container-highest: #32353A;

	/* 变体 */
	--md-sys-color-surface-variant: #43474E;
	--md-sys-color-on-surface-variant: #C3C6CF;
	--md-sys-color-outline: #8D9199;
	--md-sys-color-outline-variant: #43474E;
}

@media (min-width: 2150px) {
	:root {
		--ui-zoom-scale: 1.25;
	}
}

@media (min-width: 3500px) {
	:root {
		--ui-zoom-scale: 2;
	}
}

@media (min-width: 4800px) {
	:root {
		--ui-zoom-scale: 3;
	}
}

@media (min-width: 7000px) {
	:root {
		--ui-zoom-scale: 4;
	}
}

/* 强制所有表单元素继承 body 的字体 */
button,
input,
textarea,
select,
.md-btn {
	font-family: inherit;
}

/* =========================================
   全局样式与滚动条
   ========================================= */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	-webkit-tap-highlight-color: transparent;
	font-family: var(--font-family);
}

/* --- 强制应用自定义滚动条样式到所有元素 --- */
*::-webkit-scrollbar {
	width: 14px;
	height: 14px;
}

/* 隐藏滚动条的上下箭头按钮，确保在所有环境下样式统一 */
*::-webkit-scrollbar-button {
	display: none;
}

*::-webkit-scrollbar-track {
	background: transparent;
	margin-block: 4px;
}

.engine-dropdown::-webkit-scrollbar-track {
	margin-block: 12px;
}

.search-suggestions::-webkit-scrollbar-track {
	margin-block: 16px;
}

.dialog-content::-webkit-scrollbar-track {
	margin-block: 24px;
}

*::-webkit-scrollbar-thumb {
	background-color: var(--md-sys-color-outline-variant);
	border-radius: 10px;
	border: 4px solid transparent;
	background-clip: content-box;
	min-height: 40px;
	transition: background-color 0.2s, border 0.2s;
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
	background-color: var(--md-sys-color-outline);
	border-width: 3px;
}

/* =========================================
   基础布局与背景
   ========================================= */
html,
body {
	height: 100%;
	width: 100%;
	overflow: hidden;
	margin: 0;
	padding: 0;
}

body {
	zoom: var(--ui-zoom-scale);
	background-color: var(--md-sys-color-background);
	color: var(--md-sys-color-on-background);
	position: relative;
	transition: background-color 0.3s ease, color 0.3s ease;
}

#wallpaper-layer,
#wallpaper-overlay {
	position: fixed;
	inset: 0;
	opacity: 0;
	transition: opacity 0.5s ease;
}

#wallpaper-layer {
	z-index: -2;
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

#wallpaper-overlay {
	z-index: -1;
	background: rgba(0, 0, 0, 0.1);
}

.main-container {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	position: absolute;
	top: 30%;
	transform: translateY(-50%);
}

/* =========================================
   搜索组件 (Search Bar)
   ========================================= */
.search-bar-wrapper {
	position: relative;
	width: var(--search-bar-width);
	z-index: 10;
	/* 将不透明度应用到父容器，以便子元素(下拉菜单)继承 */
	transition: opacity 0.2s;
}

@media screen and (max-width: 650px) {
	:root {
		--search-bar-width: calc(100% - 48px);
		--search-bar-height: 56px;
	}
}

.search-bar-container {
	width: 100%;
	height: var(--search-bar-height);
	background-color: var(--md-sys-color-surface-container-high);
	border-radius: var(--search-bar-radius);
	display: flex;
	align-items: center;
	padding: 0 6px;
	transition: background-color 0.2s;
}

.search-bar-container:hover,
.search-bar-container:focus-within {
	background-color: var(--md-sys-color-surface-container);
}

#searchForm {
	flex: 1;
	height: 100%;
	display: flex;
	align-items: center;
	margin: 0 8px;
}

#searchInput {
	width: 100%;
	background: transparent;
	border: none;
	outline: none;
	font-size: 1.1rem;
	color: var(--md-sys-color-on-surface);
	padding: 0;
	line-height: 28px;
	height: 28px;
	font-family: 'Product Sans', 'Noto Sans SC', sans-serif;
}

/* =========================================
   下拉菜单 & 搜索建议
   ========================================= */
.engine-dropdown,
.search-suggestions {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	background-color: var(--md-sys-color-surface-container);
	border-radius: 20px;
	padding: 14px 0 14px 14px;
	display: none;
	flex-direction: column;
	gap: 2px;
	max-height: 60vh;
	overflow-y: auto;
	scrollbar-gutter: stable;
	transform-origin: top center;
	animation: menuIn 0.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

.engine-dropdown {
	width: 260px;
	border-radius: 16px;
	z-index: 20;
	transform-origin: top left;
}

.search-suggestions {
	width: 100%;
	z-index: 9;
}

.engine-dropdown.show {
	display: flex;
}

.engine-option,
.suggestion-item {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	cursor: pointer;
	color: var(--md-sys-color-on-surface);
	font-size: 1rem;
	border-radius: 12px;
	transition: background-color 0.1s;
}

.engine-option {
	justify-content: space-between;
	font-size: 0.95rem;
}

.engine-option-left {
	display: flex;
	align-items: center;
}

.suggestion-item {
	gap: 16px;
}

.engine-option span,
.suggestion-item span,
.setting-name,
.setting-action-row span,
.custom-select-trigger span,
.md-btn span {
	position: relative;
	top: -1px;
}

/* 统一电脑端和移动端的点击/触摸反馈样式 */
.engine-option:hover,
.engine-option:active,
.suggestion-item:hover,
.suggestion-item:active,
.engine-option.active,
.suggestion-item.active,
.engine-option.touch-active,
.suggestion-item.touch-active {
	background-color: var(--md-sys-color-surface-container-highest);
}

.engine-option:active,
.suggestion-item:active {
	transition: none;
}

.engine-option.selected {
	background-color: var(--md-sys-color-secondary-container);
	color: var(--md-sys-color-on-secondary-container);
	font-weight: 500;
}

.engine-option .engine-check-icon {
	display: none;
}

.engine-option.selected .engine-check-icon {
	display: block;
}

.suggestion-icon {
	width: 20px;
	height: 20px;
	fill: var(--md-sys-color-on-surface-variant);
}

/* =========================================
   模态框 (Dialog)
   ========================================= */
dialog {
	border: none;
	border-radius: 28px;
	background-color: var(--md-sys-color-surface-container);
	color: var(--md-sys-color-on-surface);
	padding: 0;
	width: min(90%, 450px);
	max-height: calc(85vh / var(--ui-zoom-scale));
	margin: auto;
	overflow: hidden;
	outline: none;
}

dialog[open] {
	animation: menuIn 0.2s cubic-bezier(0.2, 0, 0, 1) forwards;
}

dialog::backdrop {
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(5px);
}

/* 子弹窗样式 */
dialog.sub-dialog {
	width: min(90%, 360px);
	z-index: 1002;
}

.dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 24px 16px 24px;
	position: sticky;
	top: 0;
	background-color: var(--md-sys-color-surface-container);
	z-index: 2;
}

.dialog-header h2 {
	font-size: 1.5rem;
	font-weight: 400;
}

/* 主设置页内容 */
.dialog-content {
	scrollbar-gutter: stable;
	padding: 0 10px 24px 24px;
	overflow-y: auto;
	max-height: calc(85vh / var(--ui-zoom-scale) - 80px);
}

/* 子弹窗内容 (编辑引擎) */
.dialog-content.no-scroll-padding {
	scrollbar-gutter: stable;
	padding: 0 10px 24px 24px;
	overflow-y: auto;
	max-height: calc(85vh / var(--ui-zoom-scale) - 80px);
}

.setting-section-title {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--md-sys-color-primary);
	margin: 20px 0 10px 4px;
}

.setting-section-title:first-of-type {
	margin-top: 0;
}

.setting-card {
	background-color: var(--md-sys-color-surface-container-high);
	border-radius: var(--card-radius);
	overflow: hidden;
}

/* =========================================
   设置项 (Setting Items)
   ========================================= */
.setting-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.setting-item:last-child,
.setting-item.no-border {
	border-bottom: none;
}

.setting-item.column {
	flex-direction: column;
	align-items: stretch;
}

.setting-text {
	flex: 1;
}

.setting-name {
	font-size: 1rem;
	color: var(--md-sys-color-on-surface);
}

.setting-desc {
	font-size: 0.85rem;
	color: var(--md-sys-color-on-surface-variant);
	margin-top: 2px;
}

/* =========================================
   搜索引擎列表 (Engine List)
   ========================================= */
.engine-list-container {
	padding-top: 8px;
}

.engine-list-item {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	margin: 4px 12px;
	border-radius: 16px;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s, transform 0.2s ease-out;
}

.engine-list-item:hover,
.engine-list-item:active,
.engine-list-item.touch-active {
	background-color: var(--md-sys-color-surface-container-highest);
}

.engine-list-item:active {
	transition: none;
}

.engine-list-item.selected {
	background-color: var(--md-sys-color-secondary-container);
}

.engine-list-item.dragging {
	opacity: 0.5;
	background-color: var(--md-sys-color-surface-container-highest);
	transform: scale(1.02);
}

/* --- 特殊样式：不可拖拽的默认引擎 --- */
.engine-list-item.fixed-item {
	cursor: default;
}

.engine-list-item.fixed-item .drag-handle,
.engine-list-item.fixed-item .delete-btn {
	display: none;
}

.engine-list-item.fixed-item .engine-actions {
	margin-right: 4px;
}

.engine-list-info {
	flex: 1;
	overflow: hidden;
}

.engine-name {
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--md-sys-color-on-surface);
	margin-bottom: 4px;
}

.engine-list-item.selected .engine-name {
	color: var(--md-sys-color-on-secondary-container);
	font-weight: 600;
}

.engine-list-item .setting-desc {
	max-width: 250px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.engine-actions {
	display: flex;
	gap: 4px;
	opacity: 0.6;
	transition: opacity 0.2s;
}

.engine-list-item:hover .engine-actions,
.engine-list-item:active .engine-actions {
	opacity: 1;
}

.drag-handle {
	width: 40px;
	height: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: grab;
	color: var(--md-sys-color-on-surface-variant);
	margin-left: 4px;
	touch-action: none;
}

.drag-handle:active {
	cursor: grabbing;
}

/* 移动端禁用的列表项 */
.engine-list-item.disabled-item {
	opacity: 0.5;
	pointer-events: none;
	background-color: transparent;
	filter: grayscale(1);
}

.engine-list-item.disabled-item:hover,
.engine-list-item.disabled-item:active {
	background-color: transparent;
}

/* =========================================
   表单与通用组件
   ========================================= */
button,
label.md-btn {
	border: none;
	background: transparent;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.md-btn {
	padding: 10px 20px;
	border-radius: 20px;
	font-size: 0.9rem;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: background-color 0.2s, filter 0.2s;
}

.md-btn.primary:hover,
.md-btn.primary:active,
.md-btn.primary.touch-active {
	filter: brightness(1.05);
}

.md-btn.primary {
	background-color: var(--md-sys-color-primary);
	color: var(--md-sys-color-on-primary);
}

.md-btn.tonal-danger {
	background-color: var(--md-sys-color-error-container);
	color: var(--md-sys-color-on-error-container);
}

.md-btn.tonal-danger:hover,
.md-btn.tonal-danger:active,
.md-btn.tonal-danger.touch-active {
	background-color: color-mix(in srgb, var(--md-sys-color-error-container), white 10%);
}

.md-btn.text {
	background: transparent;
	color: var(--md-sys-color-primary);
}

.md-btn.text:hover,
.md-btn.text:active,
.md-btn.text.touch-active {
	background-color: color-mix(in srgb, var(--md-sys-color-primary), transparent 92%);
}

.md-btn:disabled {
	background-color: color-mix(in srgb, var(--md-sys-color-on-surface), transparent 88%);
	color: color-mix(in srgb, var(--md-sys-color-on-surface), transparent 62%);
	cursor: not-allowed;
}

.md-btn:active,
.md-btn.primary:active,
.md-btn.tonal-danger:active,
.md-btn.text:active {
	transition: none;
}

.icon-btn-wrapper,
.icon-btn {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	border-radius: 50%;
	transition: background-color 0.2s;
	background: transparent;
	flex-shrink: 0;
}

.icon-btn-wrapper {
	width: 40px;
	height: 40px;
}

.icon-btn-wrapper:hover,
.icon-btn-wrapper:active,
.icon-btn:hover,
.icon-btn:active,
.icon-btn-wrapper.touch-active,
.icon-btn.touch-active {
	background-color: color-mix(in srgb, var(--md-sys-color-on-surface), transparent 92%);
}

.icon-btn-wrapper:active,
.icon-btn:active {
	transition: none;
}

.close-dialog-btn {
	width: 40px;
	height: 40px;
	color: var(--md-sys-color-on-surface);
}

.icon-btn.small {
	width: 32px;
	height: 32px;
	color: var(--md-sys-color-on-surface-variant);
}

.icon-btn.small:hover,
.icon-btn.small:active,
.icon-btn.small.touch-active {
	background-color: var(--md-sys-color-outline-variant);
	color: var(--md-sys-color-on-surface);
}

.icon-btn.small.delete-btn:hover,
.icon-btn.small.delete-btn:active,
.icon-btn.small.delete-btn.touch-active {
	background-color: var(--md-sys-color-error-container);
	color: var(--md-sys-color-on-error-container);
}

.icon-btn.small.delete-btn:disabled {
	background-color: transparent;
	color: color-mix(in srgb, var(--md-sys-color-on-surface-variant), transparent 62%);
	pointer-events: none;
}

.input-group {
	margin-bottom: 20px;
}

.input-group label {
	display: block;
	font-size: 0.85rem;
	color: var(--md-sys-color-primary);
	margin-bottom: 8px;
	margin-left: 4px;
}

.md-input {
	width: 100%;
	background-color: var(--md-sys-color-surface-container);
	border: 2px solid var(--md-sys-color-outline);
	border-radius: 12px;
	padding: 9px 16px 9px 16px;
	line-height: 24px;
	color: var(--md-sys-color-on-surface);
	font-size: 1rem;
	outline: none;
	transition: border-color 0.2s;
	font-family: inherit;
}

.md-input:focus {
	border-color: var(--md-sys-color-primary);
}

.md-input:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background-color: var(--md-sys-color-surface-container-highest);
}

.md-icon {
	width: 24px;
	height: 24px;
	fill: var(--md-sys-color-on-surface-variant);
}

.md-icon-small {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* --- 图标容器与回退机制 --- */
.icon-container {
	position: relative;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.engine-option .icon-container {
	width: 20px;
	height: 20px;
	margin-right: 12px;
}

.engine-icon-img {
	width: 100%;
	height: 100%;
	border-radius: 4px;
	object-fit: contain;
}

.engine-icon-img[src=""] {
	display: none;
}

.fallback-icon {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	fill: var(--md-sys-color-on-surface-variant);
}

.engine-icon-img+.fallback-icon {
	display: none;
}

.engine-icon-img[style*="display: none"]+.fallback-icon {
	display: block;
}

.engine-check-icon {
	width: 20px;
	height: 20px;
	fill: var(--md-sys-color-on-secondary-container);
}

.arrow-icon {
	width: 18px;
	height: 18px;
	fill: var(--md-sys-color-on-surface-variant);
	margin-left: 8px;
	transition: transform 0.2s;
}

/* =========================================
   特定组件
   ========================================= */

.slider-wrapper {
	position: relative;
	width: 100%;
	height: 40px;
	display: flex;
	align-items: center;
	margin-bottom: 4px;
	isolation: isolate;
}

.slider-track {
	position: absolute;
	inset: 0;
	border-radius: 20px;
	background: linear-gradient(to right,
			var(--md-sys-color-primary) 0%,
			var(--md-sys-color-primary) var(--value, 90%),
			var(--md-sys-color-surface-container-highest) var(--value, 90%),
			var(--md-sys-color-surface-container-highest) 100%);
	z-index: 1;
	pointer-events: none;
}

.md-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
	margin: 0;
	cursor: pointer;
	background: transparent;
	z-index: 3;
	outline: none;
}

.md-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 0;
	height: 0;
	opacity: 0;
}

.slider-value-text {
	position: absolute;
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.95rem;
	font-weight: 500;
	pointer-events: none;
	z-index: 2;
	transition: none;
}

.filled-text {
	color: var(--md-sys-color-on-primary);
	clip-path: inset(0 calc(100% - var(--text-clip, 0%)) 0 0);
}

.empty-text {
	color: var(--md-sys-color-on-surface);
	clip-path: inset(0 0 0 var(--text-clip, 0%));
}

/* --- 自定义下拉选择框 --- */
.custom-select-wrapper {
	position: relative;
	min-width: 130px;
	font-size: 0.9rem;
}

.custom-select-wrapper.open {
	z-index: 100 !important;
}

.custom-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background-color: var(--md-sys-color-surface-container);
	color: var(--md-sys-color-on-surface);
	border-radius: 12px;
	cursor: pointer;
	transition: background-color 0.2s;
	min-width: 140px;
}

.custom-select-trigger:hover,
.custom-select-trigger:active,
.custom-select-trigger.touch-active {
	background-color: var(--md-sys-color-surface-container-highest);
}

.custom-select-wrapper.open .arrow-icon {
	transform: rotate(180deg);
}

.custom-select-options {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	width: max-content;
	min-width: 100%;
	background-color: var(--md-sys-color-surface-container-highest);
	border-radius: 12px;
	padding: 6px;
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.custom-select-wrapper.open .custom-select-options {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.custom-select-wrapper.drop-up .custom-select-options {
	top: auto;
	bottom: -14px;
	margin-bottom: 0;
	transform: translateY(10px);
}

.custom-select-wrapper.full-width .custom-select-options {
	right: unset;
	left: 0;
	width: 100%;
}

.custom-option {
	padding: 10px 14px;
	border-radius: 8px;
	cursor: pointer;
	color: var(--md-sys-color-on-surface);
	transition: background-color 0.2s;
}

.custom-option:hover,
.custom-option:active,
.custom-option.touch-active {
	background-color: color-mix(in srgb, var(--md-sys-color-on-surface), transparent 92%);
}

.custom-option.selected {
	background-color: var(--md-sys-color-secondary-container);
	color: var(--md-sys-color-on-secondary-container);
	font-weight: 500;
}

.custom-select-wrapper.full-width .custom-select-trigger {
	background-color: var(--md-sys-color-surface-container);
	border: 2px solid var(--md-sys-color-outline);
	border-radius: 12px;
	padding: 11px 16px;
}

.custom-select-wrapper.full-width:hover .custom-select-trigger,
.custom-select-wrapper.full-width:active .custom-select-trigger,
.custom-select-wrapper.full-width.open .custom-select-trigger {
	border-color: var(--md-sys-color-on-surface-variant);
}

.setting-action-row {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	margin: 4px 12px 12px 12px;
	cursor: pointer;
	color: var(--md-sys-color-primary);
	font-weight: 500;
	font-size: 1.05rem;
	transition: background-color 0.2s;
	border-radius: 16px;
}

.setting-action-row:hover,
.setting-action-row:active,
.setting-action-row.touch-active {
	background-color: var(--md-sys-color-surface-container-highest);
}

.custom-option:active {
	transition: none;
}

.custom-select-trigger:active {
	transition: none;
}

.setting-action-row:active {
	transition: none;
}

.action-icon-bg {
	margin-right: 16px;
	fill: currentColor;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	width: 24px;
}

/* --- 壁纸设置按钮网格 --- */
.wallpaper-actions {
	padding: 0 20px 20px 20px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.wallpaper-actions .md-btn {
	width: 100%;
	padding: 10px 12px;
	font-size: 0.9rem;
	gap: 8px;
	white-space: nowrap;
}

.wallpaper-actions .md-btn.text {
	background-color: var(--md-sys-color-surface-container);
}

.wallpaper-actions .md-btn.text:hover,
.wallpaper-actions .md-btn.text:active,
.wallpaper-actions .md-btn.text.touch-active {
	background-color: var(--md-sys-color-surface-container-highest);
}

/* 当前选中的壁纸源高亮 */
.wallpaper-actions .md-btn.active-source {
	background-color: var(--md-sys-color-secondary-container);
	color: var(--md-sys-color-on-secondary-container);
	font-weight: bold;
	border: 1px solid var(--md-sys-color-primary);
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 24px;
}

@keyframes menuIn {
	from {
		opacity: 0;
		transform: scale(0.95);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* =========================================
   移动端响应式适配 (Mobile Responsiveness)
   ========================================= */
@media screen and (max-width: 600px) {
	.wallpaper-actions {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.wallpaper-actions .md-btn {
		white-space: normal;
		height: auto;
		padding-top: 12px;
		padding-bottom: 12px;
	}

	.dialog-header {
		padding: 16px 20px;
	}

	/* 20px左边距 - 14px滚动条宽度 = 6px右边距 */
	.dialog-content {
		padding: 0 6px 20px 20px;
	}

	.dialog-content.no-scroll-padding {
		padding: 0 20px 20px 20px;
	}
}