/* ============================================================
   admin-theme.css v1 · 后台 20 主题联动层
   变量由 admin-theme.js 动态写入 documentElement：
   --la 主色 / --lb 辅色 / --la-06..45 透明梯度 / --lag 辉光
   覆盖 Ant Design Vue 1.x 主要视觉面，全部 !important。
   登录页（body.userLayout）不注入面板。
   ============================================================ */

/* ===== 文本选中 / 滚动条 ===== */
html body ::selection { background: var(--la-30) !important; }
html body ::-webkit-scrollbar-thumb { background: var(--la-45) !important; border-radius: 6px !important; }
html body ::-webkit-scrollbar-thumb:hover { background: var(--la) !important; }

/* ===== 链接 ===== */
html body a { color: var(--la) !important; }
html body a:hover { color: var(--lb) !important; }
html body .ant-btn-link { color: var(--la) !important; }
html body .ant-btn-link:hover { color: var(--lb) !important; }
/* 菜单/侧栏内链接保持菜单本色，避免整栏被主题色染色 */
html body .ant-menu a,
html body .ant-menu-dark .ant-menu-item > a,
html body .ant-menu-dark .ant-menu-submenu-title > a { color: inherit !important; }
html body .ant-menu a:hover { color: inherit !important; }

/* ===== 头像统一主题渐变 ===== */
html body .ant-avatar {
  background: linear-gradient(135deg, var(--la), var(--lb)) !important;
  color: #fff !important;
}

/* ===== 侧边菜单（暗色） ===== */
html body .ant-menu.ant-menu-dark .ant-menu-item-selected {
  background: linear-gradient(90deg, var(--la), var(--lb)) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px -4px var(--lag) !important;
}
html body .ant-menu.ant-menu-dark .ant-menu-item:hover {
  background: var(--la-18) !important;
  color: #fff !important;
}
html body .ant-menu.ant-menu-dark .ant-menu-submenu-selected > .ant-menu-submenu-title {
  color: var(--la) !important;
}
html body .ant-menu.ant-menu-dark .ant-menu-submenu-title:hover { color: #fff !important; }
html body .ant-menu-submenu-popup .ant-menu-item-selected { color: var(--la) !important; }
html body .ant-menu-light .ant-menu-item-selected,
html body .ant-menu-light .ant-menu-item-active {
  color: var(--la) !important;
  background: var(--la-06) !important;
}

/* ===== 头部 ===== */
html body .top-nav-header-index .ant-menu-horizontal > .ant-menu-item-active,
html body .top-nav-header-index .ant-menu-horizontal > .ant-menu-submenu-active {
  color: var(--la) !important;
  border-bottom: 2px solid var(--la) !important;
}
html body .ant-layout-header .ant-menu-horizontal { border-bottom-color: transparent !important; }

/* ===== 按钮 ===== */
html body .ant-btn-primary {
  background: var(--la) !important;
  border-color: var(--la) !important;
  box-shadow: 0 2px 10px -2px var(--lag) !important;
}
html body .ant-btn-primary:not([disabled]):hover {
  background: var(--lb) !important;
  border-color: var(--lb) !important;
}
html body .ant-btn-primary:not([disabled]):active { filter: brightness(.92) !important; }
html body .ant-btn-background-ghost.ant-btn-primary { color: var(--la) !important; }
html body .ant-btn-dashed:hover, html body .ant-btn-default:not(.ant-btn-primary):hover {
  color: var(--la) !important;
  border-color: var(--la) !important;
}

/* ===== 表单控件 ===== */
html body .ant-input:hover,
html body .ant-input-number:hover,
html body .ant-select-selection:hover,
html body .ant-time-picker-input:hover {
  border-color: var(--la-45) !important;
}
html body .ant-input:focus,
html body .ant-input-focused,
html body .ant-input-number-focused,
html body .ant-select-focused .ant-select-selection,
html body .ant-time-picker-input:focus {
  border-color: var(--la) !important;
  box-shadow: 0 0 0 2px var(--la-18) !important;
}
html body .ant-input-affix-wrapper .ant-input:focus { box-shadow: none !important; }
html body .ant-calendar-picker:hover .ant-calendar-picker-input { border-color: var(--la-45) !important; }

html body .ant-checkbox-checked .ant-checkbox-inner {
  background-color: var(--la) !important;
  border-color: var(--la) !important;
}
html body .ant-checkbox-wrapper:hover .ant-checkbox-inner,
html body .ant-checkbox:hover .ant-checkbox-inner { border-color: var(--la) !important; }
html body .ant-checkbox-indeterminate .ant-checkbox-inner { background-color: var(--la) !important; border-color: var(--la) !important; }

html body .ant-radio-checked .ant-radio-inner { border-color: var(--la) !important; }
html body .ant-radio-checked .ant-radio-inner::after { background-color: var(--la) !important; }
html body .ant-radio:hover .ant-radio-inner { border-color: var(--la) !important; }
html body .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
  color: var(--la) !important;
  border-color: var(--la) !important;
}
html body .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)::before { background: var(--la) !important; }

html body .ant-switch-checked { background-color: var(--la) !important; }

/* ===== 分页 ===== */
html body .ant-pagination-item:hover,
html body .ant-pagination-item-active {
  border-color: var(--la) !important;
}
html body .ant-pagination-item:hover a,
html body .ant-pagination-item-active a { color: var(--la) !important; }
html body .ant-pagination-next:hover a, html body .ant-pagination-prev:hover a,
html body .ant-pagination-jump-prev .ant-pagination-item-link-icon,
html body .ant-pagination-jump-next .ant-pagination-item-link-icon { color: var(--la) !important; }

/* ===== 标签页 ===== */
html body .ant-tabs-tab:hover { color: var(--la) !important; }
html body .ant-tabs-tab-active { color: var(--la) !important; }
html body .ant-tabs-ink-bar { background-color: var(--la) !important; }

/* ===== 表格 ===== */
html body .ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
  background: var(--la-06) !important;
}
html body .ant-table-tbody > tr.ant-table-row-selected td { background: var(--la-12) !important; }
html body .ant-table-column-sorter-up.active,
html body .ant-table-column-sorter-down.active { color: var(--la) !important; }
html body .ant-table-filter-dropdown .ant-dropdown-menu-item-selected { color: var(--la) !important; }

/* ===== 下拉菜单 ===== */
html body .ant-dropdown-menu-item:hover,
html body .ant-dropdown-menu-submenu-title:hover { background-color: var(--la-06) !important; }
html body .ant-dropdown-menu-item-selected { color: var(--la) !important; background-color: var(--la-06) !important; }

/* ===== 其他组件 ===== */
html body .ant-badge-count { background: var(--la) !important; box-shadow: 0 0 0 1px #fff !important; }
html body .ant-spin .ant-spin-dot-item { background-color: var(--la) !important; }
html body .ant-progress:not(.ant-progress-circle) .ant-progress-bg { background-color: var(--la) !important; }
html body .ant-steps-item-process .ant-steps-item-icon {
  background: var(--la) !important;
  border-color: var(--la) !important;
}
html body .ant-steps-item-finish .ant-steps-item-icon .ant-steps-icon { color: var(--la) !important; }
html body .ant-steps-item-finish .ant-steps-item-tail::after { background-color: var(--la) !important; }
html body .ant-tree-node-selected { background-color: var(--la-18) !important; }
html body .ant-calendar-selected-day .ant-calendar-date {
  background: var(--la) !important;
  color: #fff !important;
}
html body .ant-calendar-date:hover { background: var(--la-18) !important; }
html body .ant-calendar-range .ant-calendar-in-range-cell::before { background: var(--la-06) !important; }
html body .ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover { border-color: var(--la) !important; }
html body .ant-tag-blue {
  color: var(--la) !important;
  background: var(--la-06) !important;
  border-color: var(--la-45) !important;
}

/* ===== 主题设置面板 ===== */
html body .adm-theme-fab {
  position: fixed !important;
  right: 22px !important;
  bottom: 84px !important;
  z-index: 1000 !important;
  width: 44px !important;
  height: 44px !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  background: linear-gradient(135deg, var(--la), var(--lb)) !important;
  box-shadow: 0 8px 22px -6px var(--lag), 0 2px 6px rgba(0,0,0,.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}
html body .adm-theme-fab:hover { transform: scale(1.08) !important; }
html body .adm-theme-panel {
  position: fixed !important;
  right: 22px !important;
  bottom: 140px !important;
  z-index: 1000 !important;
  width: 236px !important;
  box-sizing: border-box !important;
  padding: 16px 16px 12px !important;
  border-radius: 14px !important;
  background: rgba(18, 24, 40, .92) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.45) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
  transition: all .22s ease !important;
}
html body .adm-theme-panel.open { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto !important; }
html body .adm-theme-head {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
}
html body .adm-theme-head em {
  display: block !important;
  font-style: normal !important;
  font-weight: 400 !important;
  font-size: 11px !important;
  color: rgba(255,255,255,.45) !important;
  margin-top: 3px !important;
}
html body .adm-theme-grid {
  display: grid !important;
  grid-template-columns: repeat(10, 1fr) !important;
  gap: 7px !important;
  margin-bottom: 10px !important;
}
html body .adm-chip {
  display: block !important;
  width: 100% !important;
  height: 15px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  opacity: .75 !important;
  transition: all .15s ease !important;
  box-sizing: border-box !important;
}
html body .adm-chip:hover { opacity: 1 !important; transform: translateY(-1px) !important; }
html body .adm-chip.on {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 3px 8px rgba(0,0,0,.4) !important;
}
html body .adm-theme-foot {
  font-size: 11px !important;
  color: rgba(255,255,255,.4) !important;
  letter-spacing: .5px !important;
}
html body .adm-theme-toast {
  position: fixed !important;
  top: 78px !important;
  left: 50% !important;
  transform: translate(-50%, -8px) !important;
  z-index: 1001 !important;
  padding: 9px 18px !important;
  border-radius: 8px !important;
  background: rgba(18, 24, 40, .92) !important;
  color: #fff !important;
  font-size: 13px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.35) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: all .25s ease !important;
}
html body .adm-theme-toast.show { opacity: 1 !important; transform: translate(-50%, 0) !important; }
html body .adm-theme-toast.warn { border-color: rgba(255, 170, 80, .55) !important; }

/* 登录页隐藏后台面板 */
html body.userLayout .adm-theme-fab,
html body.userLayout .adm-theme-panel,
html body.userLayout .adm-theme-toast { display: none !important; }

/* ===== v2 · 参数配置页内嵌主题卡片 ===== */
html body .adm-theme-card {
  margin: 18px 0 4px;
  padding: 18px 20px 14px;
  border-radius: 10px;
  background: linear-gradient(165deg, var(--la-06), rgba(255,255,255,.6));
  border: 1px solid var(--la-30);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}
html body .adm-card-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px;
}
html body .adm-card-title {
  font-size: 15px; font-weight: 600; color: #1f2937; position: relative; padding-left: 10px;
}
html body .adm-card-title::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
  border-radius: 2px; background: linear-gradient(180deg, var(--la), var(--lb));
}
html body .adm-card-cur { font-size: 12px; color: #6b7280; }
html body .adm-card-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px;
}
html body .adm-card-grid .adm-chip {
  display: block; width: 100%; aspect-ratio: 2 / 1.4; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; opacity: .85; transition: all .15s ease; position: relative;
}
html body .adm-card-grid .adm-chip:hover { opacity: 1; transform: translateY(-2px); }
html body .adm-card-grid .adm-chip.on {
  border-color: #1f2937; opacity: 1;
  box-shadow: 0 2px 8px var(--la-30);
}
html body .adm-card-grid .adm-chip.on::after {
  content: "✓"; position: absolute; right: 3px; top: 1px;
  font-size: 10px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
html body .adm-card-foot { margin-top: 10px; font-size: 12px; color: #9ca3af; }
@media (max-width: 900px) { html body .adm-card-grid { grid-template-columns: repeat(5, 1fr); } }

/* ===== v3 · 参数配置页「下拉列表 + 保存」卡片 ===== */
html body .adm-card-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
html body .adm-theme-select {
  flex: 1; height: 36px; padding: 0 10px; font-size: 13px; color: #374151;
  border: 1px solid var(--la-45); border-radius: 6px; background: #fff;
  outline: none; transition: border-color .15s ease;
}
html body .adm-theme-select:focus { border-color: var(--la) !important; box-shadow: 0 0 0 2px var(--la-18) !important; }
html body .adm-theme-save { background: linear-gradient(135deg, var(--la), var(--lb)) !important; border: none !important; }

/* ===== v4 · 菜单底色与字体深度跟随主题（丝滑版） ===== */
html body .ant-layout-sider,
html body .ant-layout-sider .ant-layout-sider-children,
html body .sider,
html body [class*=sider] {
  background: linear-gradient(180deg, var(--menu-bg1) 0%, var(--menu-bg2) 100%) !important;
  transition: background 0.35s ease !important;
}
/* 菜单文字颜色 */
html body .ant-menu-dark .ant-menu-item,
html body .ant-menu-dark .ant-menu-submenu-title,
html body .ant-menu-dark .ant-menu-item > a,
html body .ant-menu-dark .ant-menu-submenu-title > a {
  color: rgba(255,255,255,.82) !important;
}
html body .ant-menu-dark .ant-menu-item-selected > a,
html body .ant-menu.ant-menu-dark .ant-menu-item-selected {
  color: #fff !important;
  background: linear-gradient(90deg, var(--la), var(--lb)) !important;
  box-shadow: 0 2px 10px var(--la-45) !important;
}
html body .ant-menu-dark .ant-menu-item:hover > a,
html body .ant-menu-dark .ant-menu-submenu-title:hover {
  color: #fff !important;
  background: var(--la-30) !important;
}
/* 顶栏 logo 文字与导航字体 */
html body .ant-layout-header a, html body .top-nav-header-index a { transition: color .15s ease !important; }
html body .ant-layout-header, html body .top-nav-header-index { border-bottom: 2px solid var(--la-18) !important; }
/* 页面主字体微调 */
html body { font-variant-ligatures: none; }
/* 全局图标颜色（anticon 默认继承） */
html body .anticon { color: inherit !important; }

/* ===== v4 · 主题命名与下拉色调预览 ===== */
html body .adm-theme-select option {
  background: #fff; color: #1f2937; padding: 6px 8px;
}
html body .adm-theme-select option:nth-child(odd) { background: #f9fafb; }
html body .adm-card-row { position: relative; }
html body .adm-card-row::before {
  content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 4px; pointer-events: none;
  background: linear-gradient(135deg, var(--la), var(--lb));
}
html body .adm-theme-select { padding-left: 32px !important; }

/* ===== v4 · 全局主题切换丝滑过渡 ===== */
html body .ant-menu,
html body .ant-menu-item, html body .ant-menu-submenu-title,
html body .ant-btn, html body .ant-layout-header, html body .ant-layout-sider,
html body a, html body .ant-card {
  transition: background-color .3s ease, color .25s ease, border-color .3s ease, box-shadow .3s ease !important;
}
html body .ant-menu-dark .ant-menu-item > a,
html body .ant-menu-dark .ant-menu-submenu-title > a {
  color: var(--menu-text) !important;
  opacity: 1 !important;
}
html body .ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) > a:hover,
html body .ant-menu-dark .ant-menu-submenu-title:hover { color: #fff !important; }
/* ===== v5 · 下拉框限宽与布局微调 ===== */
html body .adm-card-row { display: flex; gap: 10px; align-items: center; max-width: 640px; }
html body .adm-theme-select {
  flex: 1 1 auto; min-width: 0; max-width: 420px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
html body .adm-theme-save { flex: 0 0 auto; }
/* 修复 v4 菜单混色过重：降低主色占比（更接近原生深色导航，主题色仅点缀） */
html body .ant-menu.ant-menu-dark .ant-menu-item-selected,
html body .ant-menu.ant-menu-dark .ant-menu-submenu-selected > .ant-menu-submenu-title {
  background: linear-gradient(90deg, var(--la-45), var(--lb-15)) !important;
  box-shadow: inset 3px 0 0 var(--la) !important;
}
