/* ============================================================
   Theme Colors — OA Salesman Mobile
   炫彩主题色 + 高对比度
   data-theme-color: default | ocean | forest | sakura
   data-high-contrast: 1
   ============================================================ */

/* ============================
   Dark Mode — 海洋蓝
   ============================ */
html[data-theme-color="ocean"] {
  --md-primary: #4DA8DA !important;
  --md-primary-rgb: 77,168,218 !important;
  --md-on-primary: #FFFFFF !important;
  --md-primary-container: #0A2A3C !important;
  --md-on-primary-container: #C8E6F5 !important;
  --md-secondary: #6E8A9A !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #14242E !important;
  --md-on-secondary-container: #C8DCE8 !important;
  --md-tertiary: #5B9BF0 !important;
  --md-tertiary-rgb: 91,155,240 !important;
  --md-on-tertiary: #FFFFFF !important;
  --md-tertiary-container: #0D2240 !important;
  --md-on-tertiary-container: #C8DFF5 !important;
  --md-inverse-primary: #5B9BF0 !important;
}

/* ============================
   Dark Mode — 森林绿
   ============================ */
html[data-theme-color="forest"] {
  --md-primary: #6ABF50 !important;
  --md-primary-rgb: 106,191,80 !important;
  --md-on-primary: #0D0D0D !important;
  --md-primary-container: #1A3318 !important;
  --md-on-primary-container: #C8F0C0 !important;
  --md-secondary: #7A9A6E !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #1E2E1A !important;
  --md-on-secondary-container: #D0E8C8 !important;
  --md-tertiary: #8BC34A !important;
  --md-tertiary-rgb: 139,195,74 !important;
  --md-on-tertiary: #0D0D0D !important;
  --md-tertiary-container: #223A18 !important;
  --md-on-tertiary-container: #D8F0C8 !important;
  --md-inverse-primary: #8BC34A !important;
}

/* ============================
   Dark Mode — 樱花粉
   ============================ */
html[data-theme-color="sakura"] {
  --md-primary: #E8889A !important;
  --md-primary-rgb: 232,136,154 !important;
  --md-on-primary: #FFFFFF !important;
  --md-primary-container: #3A1822 !important;
  --md-on-primary-container: #F5C8D0 !important;
  --md-secondary: #9A6E7A !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #2E141E !important;
  --md-on-secondary-container: #E8C8D0 !important;
  --md-tertiary: #F0A0B0 !important;
  --md-tertiary-rgb: 240,160,176 !important;
  --md-on-tertiary: #FFFFFF !important;
  --md-tertiary-container: #401828 !important;
  --md-on-tertiary-container: #F5D0D8 !important;
  --md-inverse-primary: #F0A0B0 !important;
}

/* ============================
   Light Mode — 海洋蓝
   ============================ */
html[data-theme="light"][data-theme-color="ocean"] {
  --md-primary: #1976D2 !important;
  --md-primary-rgb: 25,118,210 !important;
  --md-on-primary: #FFFFFF !important;
  --md-primary-container: #D0E8FF !important;
  --md-on-primary-container: #0A3060 !important;
  --md-secondary: #507A9A !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #D8E8F5 !important;
  --md-on-secondary-container: #1A3A5A !important;
  --md-tertiary: #42A5F5 !important;
  --md-tertiary-rgb: 66,165,245 !important;
  --md-on-tertiary: #FFFFFF !important;
  --md-tertiary-container: #D0E8FF !important;
  --md-on-tertiary-container: #0A3060 !important;
  --md-inverse-primary: #42A5F5 !important;
}

/* ============================
   Light Mode — 森林绿
   ============================ */
html[data-theme="light"][data-theme-color="forest"] {
  --md-primary: #388E3C !important;
  --md-primary-rgb: 56,142,60 !important;
  --md-on-primary: #FFFFFF !important;
  --md-primary-container: #C8F5CA !important;
  --md-on-primary-container: #1A4A1C !important;
  --md-secondary: #5A8A50 !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #D8F0D0 !important;
  --md-on-secondary-container: #2A4A20 !important;
  --md-tertiary: #66BB6A !important;
  --md-tertiary-rgb: 102,187,106 !important;
  --md-on-tertiary: #FFFFFF !important;
  --md-tertiary-container: #C8F5CA !important;
  --md-on-tertiary-container: #1A4A1C !important;
  --md-inverse-primary: #66BB6A !important;
}

/* ============================
   Light Mode — 樱花粉
   ============================ */
html[data-theme="light"][data-theme-color="sakura"] {
  --md-primary: #E91E63 !important;
  --md-primary-rgb: 233,30,99 !important;
  --md-on-primary: #FFFFFF !important;
  --md-primary-container: #FFD8E0 !important;
  --md-on-primary-container: #6A0A28 !important;
  --md-secondary: #9A5070 !important;
  --md-on-secondary: #FFFFFF !important;
  --md-secondary-container: #F5D0E0 !important;
  --md-on-secondary-container: #5A1A3A !important;
  --md-tertiary: #F06292 !important;
  --md-tertiary-rgb: 240,98,146 !important;
  --md-on-tertiary: #FFFFFF !important;
  --md-tertiary-container: #FFD8E0 !important;
  --md-on-tertiary-container: #6A0A28 !important;
  --md-inverse-primary: #F06292 !important;
}

/* ============================
   Dark Mode — 组件硬编码覆盖
   ============================ */

/* Loading 渐变 */
html[data-theme-color="ocean"] .page-loading__brand,
html[data-theme-color="ocean"] .page-loading__subtitle {
  background: linear-gradient(135deg, #4DA8DA, #7BC0E8, #2E80AA) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme-color="ocean"] .page-loading-progress {
  background: linear-gradient(90deg, #2E80AA 0%, #4DA8DA 50%, #7BC0E8 100%) !important;
  box-shadow: 0 0 0.4rem rgba(77, 168, 218, 0.3) !important;
}
html[data-theme-color="ocean"] .page-loading__spinner circle {
  stroke: #4DA8DA !important;
}

html[data-theme-color="forest"] .page-loading__brand,
html[data-theme-color="forest"] .page-loading__subtitle {
  background: linear-gradient(135deg, #6ABF50, #8BD070, #4A9A38) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme-color="forest"] .page-loading-progress {
  background: linear-gradient(90deg, #4A9A38 0%, #6ABF50 50%, #8BD070 100%) !important;
  box-shadow: 0 0 0.4rem rgba(106, 191, 80, 0.3) !important;
}
html[data-theme-color="forest"] .page-loading__spinner circle {
  stroke: #6ABF50 !important;
}

html[data-theme-color="sakura"] .page-loading__brand,
html[data-theme-color="sakura"] .page-loading__subtitle {
  background: linear-gradient(135deg, #E8889A, #F0A8B8, #C06878) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme-color="sakura"] .page-loading-progress {
  background: linear-gradient(90deg, #C06878 0%, #E8889A 50%, #F0A8B8 100%) !important;
  box-shadow: 0 0 0.4rem rgba(232, 136, 154, 0.3) !important;
}
html[data-theme-color="sakura"] .page-loading__spinner circle {
  stroke: #E8889A !important;
}

/* ============================
   Light Mode — 组件硬编码覆盖
   ============================ */

/* Footer active color */
html[data-theme="light"][data-theme-color="ocean"] .footer .item.active,
html[data-theme="light"][data-theme-color="ocean"] .footer .item.active .iconfont {
  color: #1976D2 !important;
}
html[data-theme="light"][data-theme-color="ocean"] .footer .item:nth-child(2).active > div {
  background: #1976D2 !important;
  box-shadow: 0 0 0.2rem 0 rgba(25,118,210,0.3) !important;
}
html[data-theme="light"][data-theme-color="forest"] .footer .item.active,
html[data-theme="light"][data-theme-color="forest"] .footer .item.active .iconfont {
  color: #388E3C !important;
}
html[data-theme="light"][data-theme-color="forest"] .footer .item:nth-child(2).active > div {
  background: #388E3C !important;
  box-shadow: 0 0 0.2rem 0 rgba(56,142,60,0.3) !important;
}
html[data-theme="light"][data-theme-color="sakura"] .footer .item.active,
html[data-theme="light"][data-theme-color="sakura"] .footer .item.active .iconfont {
  color: #E91E63 !important;
}
html[data-theme="light"][data-theme-color="sakura"] .footer .item:nth-child(2).active > div {
  background: #E91E63 !important;
  box-shadow: 0 0 0.2rem 0 rgba(233,30,99,0.3) !important;
}

/* Loading 渐变 (light mode) */
html[data-theme="light"][data-theme-color="ocean"] .page-loading__brand,
html[data-theme="light"][data-theme-color="ocean"] .page-loading__subtitle {
  background: linear-gradient(135deg, #1565C0, #1976D2, #42A5F5) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme="light"][data-theme-color="ocean"] .page-loading-progress {
  background: linear-gradient(90deg, #1565C0 0%, #1976D2 50%, #42A5F5 100%) !important;
  box-shadow: 0 0 0.4rem rgba(25, 118, 210, 0.25) !important;
}
html[data-theme="light"][data-theme-color="ocean"] .page-loading__spinner circle {
  stroke: #1976D2 !important;
}

html[data-theme="light"][data-theme-color="forest"] .page-loading__brand,
html[data-theme="light"][data-theme-color="forest"] .page-loading__subtitle {
  background: linear-gradient(135deg, #2E7D32, #388E3C, #66BB6A) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme="light"][data-theme-color="forest"] .page-loading-progress {
  background: linear-gradient(90deg, #2E7D32 0%, #388E3C 50%, #66BB6A 100%) !important;
  box-shadow: 0 0 0.4rem rgba(56, 142, 60, 0.25) !important;
}
html[data-theme="light"][data-theme-color="forest"] .page-loading__spinner circle {
  stroke: #388E3C !important;
}

html[data-theme="light"][data-theme-color="sakura"] .page-loading__brand,
html[data-theme="light"][data-theme-color="sakura"] .page-loading__subtitle {
  background: linear-gradient(135deg, #C2185B, #E91E63, #F06292) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
html[data-theme="light"][data-theme-color="sakura"] .page-loading-progress {
  background: linear-gradient(90deg, #C2185B 0%, #E91E63 50%, #F06292 100%) !important;
  box-shadow: 0 0 0.4rem rgba(233, 30, 99, 0.25) !important;
}
html[data-theme="light"][data-theme-color="sakura"] .page-loading__spinner circle {
  stroke: #E91E63 !important;
}

/* 首页 dashboard 硬编码覆盖 (light mode) */
html[data-theme="light"][data-theme-color="ocean"] .index .dash-header .user-role-tag {
  color: #1976D2 !important;
  border-color: rgba(25,118,210,0.3) !important;
  background: rgba(25,118,210,0.08) !important;
}
html[data-theme="light"][data-theme-color="ocean"] .todo-notice-card {
  border-color: rgba(25,118,210,0.2) !important;
}
html[data-theme="light"][data-theme-color="ocean"] .todo-notice-card .more-link {
  color: #1976D2 !important;
}
html[data-theme="light"][data-theme-color="ocean"] .todo-notice-card .tag-gold {
  background: rgba(25,118,210,0.1) !important;
  color: #1565C0 !important;
  border-color: rgba(25,118,210,0.25) !important;
}

html[data-theme="light"][data-theme-color="forest"] .index .dash-header .user-role-tag {
  color: #388E3C !important;
  border-color: rgba(56,142,60,0.3) !important;
  background: rgba(56,142,60,0.08) !important;
}
html[data-theme="light"][data-theme-color="forest"] .todo-notice-card {
  border-color: rgba(56,142,60,0.2) !important;
}
html[data-theme="light"][data-theme-color="forest"] .todo-notice-card .more-link {
  color: #388E3C !important;
}
html[data-theme="light"][data-theme-color="forest"] .todo-notice-card .tag-gold {
  background: rgba(56,142,60,0.1) !important;
  color: #2E7D32 !important;
  border-color: rgba(56,142,60,0.25) !important;
}

html[data-theme="light"][data-theme-color="sakura"] .index .dash-header .user-role-tag {
  color: #E91E63 !important;
  border-color: rgba(233,30,99,0.3) !important;
  background: rgba(233,30,99,0.08) !important;
}
html[data-theme="light"][data-theme-color="sakura"] .todo-notice-card {
  border-color: rgba(233,30,99,0.2) !important;
}
html[data-theme="light"][data-theme-color="sakura"] .todo-notice-card .more-link {
  color: #E91E63 !important;
}
html[data-theme="light"][data-theme-color="sakura"] .todo-notice-card .tag-gold {
  background: rgba(233,30,99,0.1) !important;
  color: #C2185B !important;
  border-color: rgba(233,30,99,0.25) !important;
}

/* ============================================================
   高对比度模式 — 提升全部页面文字可读性
   ============================================================ */

/* --- Dark + 高对比度：变量覆盖 --- */
html[data-high-contrast="1"]:not([data-theme="light"]) {
  --md-on-surface: #FFFFFF !important;
  --md-on-surface-variant: #D0D0D0 !important;
  --md-outline: #8A8060 !important;
  --md-outline-variant: #4A4430 !important;
  --md-inverse-surface: #FFFFFF !important;
}

/* --- Light + 高对比度：变量覆盖 --- */
html[data-high-contrast="1"][data-theme="light"] {
  --md-on-surface: #000000 !important;
  --md-on-surface-variant: #333333 !important;
  --md-outline: #888888 !important;
  --md-outline-variant: #BDBDBD !important;
  --md-inverse-surface: #000000 !important;
}

/* --- 通用：字体加粗 --- */
html[data-high-contrast="1"] body {
  font-weight: 500 !important;
}

/* ============================
   Dark 高对比度 — 组件覆盖
   ============================ */

/* 输入框 */
html[data-high-contrast="1"]:not([data-theme="light"]) input,
html[data-high-contrast="1"]:not([data-theme="light"]) select,
html[data-high-contrast="1"]:not([data-theme="light"]) textarea {
  color: #FFFFFF !important;
}

/* Footer 底部导航 */
html[data-high-contrast="1"]:not([data-theme="light"]) .footer .item {
  color: #A89F8E !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .footer .item.active {
  color: #F5E6C8 !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .footer .item.active .iconfont {
  color: #F5E6C8 !important;
}

/* Navbar */
html[data-high-contrast="1"]:not([data-theme="light"]) .navbar .title {
  color: #FFFFFF !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .navbar .back-btn {
  color: #FFFFFF !important;
}

/* 列表页 */
html[data-high-contrast="1"]:not([data-theme="light"]) .lr-item__title {
  color: #FFFFFF !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .lr-item__body {
  color: #D0D0D0 !important;
}

/* 详情页 */
html[data-high-contrast="1"]:not([data-theme="light"]) .dd-field-label {
  color: #D0D0D0 !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .dd-field-value {
  color: #FFFFFF !important;
}

/* 筛选面板 */
html[data-high-contrast="1"]:not([data-theme="light"]) .fp-label {
  color: #D0D0D0 !important;
}

/* Dialog / ActionSheet */
html[data-high-contrast="1"]:not([data-theme="light"]) .ui-dialog__title {
  color: #FFFFFF !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .ui-dialog__body {
  color: #D0D0D0 !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .ui-actionsheet__header {
  color: #FFFFFF !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .ui-actionsheet__item {
  color: #FFFFFF !important;
}
html[data-high-contrast="1"]:not([data-theme="light"]) .ui-actionsheet__cancel {
  color: #D0D0D0 !important;
}

/* ============================
   Light 高对比度 — 组件覆盖
   ============================ */

/* 输入框 */
html[data-high-contrast="1"][data-theme="light"] input,
html[data-high-contrast="1"][data-theme="light"] select,
html[data-high-contrast="1"][data-theme="light"] textarea {
  color: #000000 !important;
}

/* Footer 底部导航 */
html[data-high-contrast="1"][data-theme="light"] .footer .item {
  color: #666666 !important;
}
html[data-high-contrast="1"][data-theme="light"] .footer .item.active {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .footer .item.active .iconfont {
  color: #000000 !important;
}

/* 首页 Dashboard */
html[data-high-contrast="1"][data-theme="light"] .index .dash-header .user-name {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .index .dash-header .header-icon-btn {
  color: #333333 !important;
}
html[data-high-contrast="1"][data-theme="light"] .index .kpi-card .kpi-value {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .index .action-btn .action-text {
  color: #000000 !important;
}

/* 待办卡片 */
html[data-high-contrast="1"][data-theme="light"] .todo-notice-card .title-text {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .todo-notice-card .sn {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .todo-notice-card .time {
  color: #555555 !important;
}
html[data-high-contrast="1"][data-theme="light"] .todo-notice-card .content-text {
  color: #333333 !important;
}
html[data-high-contrast="1"][data-theme="light"] .todo-notice-card .notice-empty {
  color: #555555 !important;
}

/* 趋势图 */
html[data-high-contrast="1"][data-theme="light"] .index .trend-tab {
  color: #333333 !important;
}

/* Profile 我的页面 */
html[data-high-contrast="1"][data-theme="light"] .profile .profile-topbar .topbar-title {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .user-card .user-name {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .user-card .user-info-item {
  color: #333333 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .profile-section .section-title {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .profile-menu-item .menu-label {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .profile-menu-item .menu-desc {
  color: #555555 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .profile-menu-item .menu-arrow {
  color: #666666 !important;
}
html[data-high-contrast="1"][data-theme="light"] .profile .logout-btn {
  color: #C62828 !important;
}

/* Navbar */
html[data-high-contrast="1"][data-theme="light"] .navbar .title {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .navbar .back-btn {
  color: #000000 !important;
}

/* 列表页 */
html[data-high-contrast="1"][data-theme="light"] .lr-item__title {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .lr-item__body {
  color: #333333 !important;
}

/* Dialog / ActionSheet */
html[data-high-contrast="1"][data-theme="light"] .ui-dialog__title {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .ui-dialog__body {
  color: #333333 !important;
}
html[data-high-contrast="1"][data-theme="light"] .ui-actionsheet__header {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .ui-actionsheet__item {
  color: #000000 !important;
}
html[data-high-contrast="1"][data-theme="light"] .ui-actionsheet__cancel {
  color: #333333 !important;
}

/* 详情页 */
html[data-high-contrast="1"][data-theme="light"] .dd-field-label {
  color: #555555 !important;
}
html[data-high-contrast="1"][data-theme="light"] .dd-field-value {
  color: #000000 !important;
}

/* 筛选面板 */
html[data-high-contrast="1"][data-theme="light"] .fp-label {
  color: #333333 !important;
}
