/**
 * iOS 风格主题系统
 * 包含深色和明亮两种主题
 */

/* ============= 覆盖原有的 CSS 变量 ============= */
/* 明亮主题（Light Mode）*/
:root[data-theme="light"] {
	/* 覆盖原有变量 */
	--bgColor: #f2f2f7 !important;
	--innerMenuBgColor: #ffffff !important;
	--lightInnerMenuHoverBgColor: #e5e5ea !important;
	--inputBgColor: #f2f2f7 !important;
	--inputFontColor: #000000 !important;
	--fontColor: #000000 !important;
	--fontWeightedColor: #000000 !important;
	--fontWeakenedColor: #8e8e93 !important;
	--buttonFontColor: #007aff !important;
	--buttonBgColor: #f2f2f7 !important;
	--buttonActiveBgColor: #007aff !important;
	--buttonHoverBgColor: #e5e5ea !important;
	--buttonHoverFontColor: #007aff !important;
	--borderColor: #c6c6c8 !important;
	
	/* iOS 背景色 */
	--ios-bg-primary: #ffffff;
	--ios-bg-secondary: #f2f2f7;
	--ios-bg-tertiary: #ffffff;
	--ios-bg-grouped: #f2f2f7;
	
	/* iOS 文字色 */
	--ios-text-primary: #000000;
	--ios-text-secondary: #3c3c43;
	--ios-text-tertiary: #3c3c4399;
	--ios-text-quaternary: #3c3c434c;
	
	/* iOS 分隔线 */
	--ios-separator: #3c3c4329;
	--ios-separator-opaque: #c6c6c8;
	
	/* iOS 填充色 */
	--ios-fill-primary: #78788033;
	--ios-fill-secondary: #78788028;
	--ios-fill-tertiary: #7676801e;
	--ios-fill-quaternary: #74748014;
	
	/* iOS 系统颜色 */
	--ios-blue: #007aff;
	--ios-green: #34c759;
	--ios-indigo: #5856d6;
	--ios-orange: #ff9500;
	--ios-pink: #ff2d55;
	--ios-purple: #af52de;
	--ios-red: #ff3b30;
	--ios-teal: #5ac8fa;
	--ios-yellow: #ffcc00;
	
	/* iOS 灰度 */
	--ios-gray: #8e8e93;
	--ios-gray2: #aeaeb2;
	--ios-gray3: #c7c7cc;
	--ios-gray4: #d1d1d6;
	--ios-gray5: #e5e5ea;
	--ios-gray6: #f2f2f7;
	
	/* 钢琴键颜色 */
	--piano-white-key: #ffffff;
	--piano-black-key: #000000;
	--piano-key-border: #d1d1d6;
	--piano-key-shadow: rgba(0, 0, 0, 0.1);
	
	/* 音符颜色 */
	--note-color-left: #007aff;
	--note-color-right: #ff2d55;
	--note-color-both: #34c759;
	
	/* 卡片阴影 */
	--card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	--card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 深色主题（Dark Mode）- 默认 */
:root[data-theme="dark"],
:root {
	/* 覆盖原有变量 */
	--bgColor: #1c1c1e !important;
	--innerMenuBgColor: #2c2c2e !important;
	--lightInnerMenuHoverBgColor: #3a3a3c !important;
	--inputBgColor: #3a3a3c !important;
	--inputFontColor: #ffffff !important;
	--fontColor: #ffffff !important;
	--fontWeightedColor: #ebebf5 !important;
	--fontWeakenedColor: #8e8e93 !important;
	--buttonFontColor: #0a84ff !important;
	--buttonBgColor: #2c2c2e !important;
	--buttonActiveBgColor: #0a84ff !important;
	--buttonHoverBgColor: #3a3a3c !important;
	--buttonHoverFontColor: #0a84ff !important;
	--borderColor: #48484a !important;
	
	/* iOS 暗色背景 */
	--ios-bg-primary: #000000;
	--ios-bg-secondary: #1c1c1e;
	--ios-bg-tertiary: #2c2c2e;
	--ios-bg-grouped: #000000;
	
	/* iOS 暗色文字 */
	--ios-text-primary: #ffffff;
	--ios-text-secondary: #ebebf5;
	--ios-text-tertiary: #ebebf599;
	--ios-text-quaternary: #ebebf54c;
	
	/* iOS 暗色分隔线 */
	--ios-separator: #54545899;
	--ios-separator-opaque: #38383a;
	
	/* iOS 暗色填充 */
	--ios-fill-primary: #7878805b;
	--ios-fill-secondary: #78788051;
	--ios-fill-tertiary: #7676803d;
	--ios-fill-quaternary: #7676802d;
	
	/* iOS 暗色系统颜色 */
	--ios-blue: #0a84ff;
	--ios-green: #30d158;
	--ios-indigo: #5e5ce6;
	--ios-orange: #ff9f0a;
	--ios-pink: #ff375f;
	--ios-purple: #bf5af2;
	--ios-red: #ff453a;
	--ios-teal: #64d2ff;
	--ios-yellow: #ffd60a;
	
	/* iOS 暗色灰度 */
	--ios-gray: #8e8e93;
	--ios-gray2: #636366;
	--ios-gray3: #48484a;
	--ios-gray4: #3a3a3c;
	--ios-gray5: #2c2c2e;
	--ios-gray6: #1c1c1e;
	
	/* 暗色钢琴键 */
	--piano-white-key: #2c2c2e;
	--piano-black-key: #000000;
	--piano-key-border: #48484a;
	--piano-key-shadow: rgba(0, 0, 0, 0.3);
	
	/* 暗色音符 */
	--note-color-left: #0a84ff;
	--note-color-right: #ff375f;
	--note-color-both: #30d158;
	
	/* 暗色卡片阴影 */
	--card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
	--card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ============= iOS 全局样式 ============= */
body {
	background-color: var(--bgColor) !important;
	color: var(--fontColor) !important;
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Source Sans Pro", Arial, sans-serif !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ============= 强制应用背景色到主要容器 ============= */
.navbar,
#leftMenu,
#trackContainerInner {
	background-color: var(--bgColor) !important;
}

#innerContentContainer,
.innerMenuContDiv {
	background-color: var(--innerMenuBgColor) !important;
}

/* ============= iOS 按钮风格 ============= */
.btn {
	background-color: var(--buttonBgColor) !important;
	color: var(--buttonFontColor) !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 8px 16px !important;
	font-weight: 600 !important;
	font-size: 14px !important;
	transition: all 0.2s ease !important;
}

.btn:hover {
	background-color: var(--buttonHoverBgColor) !important;
	color: var(--buttonHoverFontColor) !important;
	transform: scale(1.02);
}

.btn:active {
	transform: scale(0.98);
	opacity: 0.8;
}

.btn.selected,
.btn.active {
	background-color: var(--buttonActiveBgColor) !important;
	color: #ffffff !important;
}

/* ============= iOS 输入框风格 ============= */
input[type="text"],
input[type="number"],
select,
.inputSelect {
	background-color: var(--inputBgColor) !important;
	color: var(--inputFontColor) !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 8px 12px !important;
	transition: all 0.2s ease !important;
}

input:focus,
select:focus {
	outline: none !important;
	box-shadow: 0 0 0 2px var(--ios-blue) !important;
}

/* ============= iOS 滑块风格 ============= */
input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	background: var(--inputBgColor) !important;
	border-radius: 2px;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	background: var(--ios-blue);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.1);
}

input[type="range"]::-webkit-slider-thumb:active {
	transform: scale(0.95);
}

/* ============= iOS 分隔线 ============= */
hr,
.ios-separator {
	border: none;
	height: 0.5px;
	background-color: var(--borderColor) !important;
	margin: 16px 0;
}

/* ============= 文字样式 ============= */
.ios-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--fontColor) !important;
	letter-spacing: -0.5px;
}

.ios-headline {
	font-size: 17px;
	font-weight: 600;
	color: var(--fontColor) !important;
}

/* ============= 滚动条 iOS 风格 ============= */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: var(--inputBgColor);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--buttonHoverBgColor);
}

/* ============= 主题切换动画 ============= */
* {
	transition-property: background-color, border-color, color, fill, stroke !important;
	transition-duration: 0.3s !important;
	transition-timing-function: ease !important;
}

/* 禁用某些元素的过渡（避免影响性能） */
canvas,
video,
img,
input[type="range"]::-webkit-slider-thumb {
	transition: none !important;
}

