/* ===== 九尾狐 · 星空主题 v5 ===== */

/* ---------- 1. 星空背景 ---------- */
html[data-theme="dark"] {
  background-color: #05090f !important;
  background-image:
    radial-gradient(1200px 640px at 50% -10%, rgba(64, 130, 200, .18), transparent 70%),
    linear-gradient(180deg, rgba(3, 6, 11, .50) 0%, rgba(3, 6, 11, .68) 60%, rgba(3, 6, 11, .80) 100%),
    url("/img/bg.jpg") !important;
  background-size: auto, auto, cover !important;
  background-position: center top, center, center 32% !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #root {
  background: transparent !important;
}

/* ---------- 2. 变量：透一点，星空能看见 ---------- */
html[data-theme="dark"] {
  --fc-bg: transparent !important;
  --fc-bg-deep: rgba(4, 7, 14, .60) !important;
  --fc-surface: rgba(13, 20, 33, .84) !important;
  --fc-surface-hi: rgba(21, 31, 47, .88) !important;
  --fc-elevated: rgba(12, 18, 30, .97) !important;
  --fc-border: rgba(96, 165, 250, .17) !important;
  --fc-border-soft: rgba(96, 165, 250, .09) !important;
  --fc-border-hi: rgba(120, 190, 255, .30) !important;
}

/* ---------- 3. 顶栏 / 侧栏 / 内容区 ---------- */
html[data-theme="dark"] .ant-layout-header {
  background: rgba(6, 11, 19, .90) !important;
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border-bottom: 1px solid rgba(96, 165, 250, .14);
}

html[data-theme="dark"] .ant-layout-sider,
html[data-theme="dark"] .ant-layout-sider-children {
  background: rgba(6, 11, 19, .90) !important;
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  border-right: 1px solid rgba(96, 165, 250, .12);
}

html[data-theme="dark"] .ant-menu {
  background: transparent !important;
}

html[data-theme="dark"] .ant-layout-content {
  background: linear-gradient(180deg, rgba(5, 10, 18, .45), rgba(5, 10, 18, .58)) !important;
}


/* 布局层必须透明，否则整块深色会盖住星空 */
html[data-theme="dark"] .ant-layout,
html[data-theme="dark"] .ant-layout-has-sider,
html[data-theme="dark"] .ant-layout-content {
  background-color: transparent !important;
}

html[data-theme="dark"] .ant-layout {
  background: transparent !important;
}

/* ---------- 4. 内联写死的浅色统一压深 ---------- */
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background: rgb(255, 255, 255)"],
html[data-theme="dark"] [style*="background:rgb(255,255,255)"],
html[data-theme="dark"] [style*="backgroundColor: #fff"] {
  background: rgba(15, 23, 38, .94) !important;
}

html[data-theme="dark"] [style*="background: rgba(0, 0, 0, 0.05)"],
html[data-theme="dark"] [style*="background: rgba(0, 0, 0, .05)"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background: #f1f5f9"],
html[data-theme="dark"] [style*="background: #f3f6fb"] {
  background: rgba(25, 36, 54, .92) !important;
}

/* 内联深字提亮 */
html[data-theme="dark"] [style*="color: #0f172a"],
html[data-theme="dark"] [style*="color:#0f172a"],
html[data-theme="dark"] [style*="color: rgb(15, 23, 42)"] {
  color: #e6edf8 !important;
}

html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #475569"],
html[data-theme="dark"] [style*="color:#475569"] {
  color: #b9c9de !important;
}

html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color: #94a3b8"],
html[data-theme="dark"] [style*="color:#94a3b8"] {
  color: #93a6bf !important;
}

/* 搜索框（内联白底 + 深字） */
html[data-theme="dark"] input[placeholder*="搜索"] {
  background: rgba(15, 23, 38, .94) !important;
  color: #e6edf8 !important;
}

html[data-theme="dark"] input[placeholder*="搜索"]::placeholder,
html[data-theme="dark"] input::placeholder {
  color: rgba(180, 198, 220, .45) !important;
}

/* ---------- 5. 顶部标题条 ---------- */
html[data-theme="dark"] .dashboard-hero {
  background: linear-gradient(120deg, rgba(14, 24, 40, .94) 0%, rgba(9, 16, 28, .94) 100%) !important;
  border: 1px solid rgba(96, 165, 250, .16) !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, .40) !important;
  color: #e6edf8 !important;
}

html[data-theme="dark"] .dashboard-hero * {
  color: #e6edf8 !important;
}

/* ---------- 6. antd 控件兜底 ---------- */
html[data-theme="dark"] .ant-btn-default {
  background: rgba(15, 23, 38, .94) !important;
  color: #d6e2f2 !important;
  border-color: rgba(96, 165, 250, .22) !important;
}

html[data-theme="dark"] .ant-select .ant-select-selector {
  background: rgba(15, 23, 38, .94) !important;
  border-color: rgba(96, 165, 250, .22) !important;
}

html[data-theme="dark"] .ant-select .ant-select-selection-item,
html[data-theme="dark"] .ant-select .ant-select-selection-placeholder {
  color: #d6e2f2 !important;
}

html[data-theme="dark"] .ant-select-dropdown {
  background: rgba(11, 18, 30, .99) !important;
  border: 1px solid rgba(96, 165, 250, .18) !important;
}

html[data-theme="dark"] .ant-select-item {
  color: #d6e2f2 !important;
}

/* ---------- 7. 品牌 ---------- */
html[data-theme="dark"] .brand-logo img,
html[data-theme="dark"] header img {
  filter: drop-shadow(0 0 20px rgba(110, 220, 255, .45));
}

.ant-layout-sider img[src*="hdkj"],
.ant-layout-sider img[src*="logo"] {
  border-radius: 50% !important;
  object-fit: contain;
}

/* ---------- 8. 滚动条 ---------- */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(110, 180, 235, .24);
  border-radius: 8px;
}

/* ---------- 9. 下拉 / 分页 深色兜底 ---------- */
html[data-theme="dark"] .ant-select .ant-select-selector {
  background: rgba(15, 23, 38, .94) !important;
  border-color: rgba(96, 165, 250, .22) !important;
}

html[data-theme="dark"] .ant-select .ant-select-selection-item,
html[data-theme="dark"] .ant-select .ant-select-selection-placeholder,
html[data-theme="dark"] .ant-select .ant-select-selection-search-input,
html[data-theme="dark"] .ant-select .ant-select-arrow,
html[data-theme="dark"] .ant-select .ant-select-clear {
  color: #d6e2f2 !important;
}

html[data-theme="dark"] .ant-pagination,
html[data-theme="dark"] .ant-pagination * {
  color: #c3d3e7 !important;
}

html[data-theme="dark"] .ant-pagination .ant-pagination-item,
html[data-theme="dark"] .ant-pagination .ant-pagination-prev,
html[data-theme="dark"] .ant-pagination .ant-pagination-next,
html[data-theme="dark"] .ant-pagination .ant-pagination-options .ant-select .ant-select-selector {
  background: rgba(15, 23, 38, .92) !important;
  border-color: rgba(96, 165, 250, .20) !important;
}

html[data-theme="dark"] .ant-pagination .ant-pagination-item-active {
  background: rgba(139, 92, 246, .30) !important;
  border-color: rgba(167, 139, 250, .60) !important;
}

html[data-theme="dark"] .ant-pagination .ant-pagination-item-active a {
  color: #ffffff !important;
}

html[data-theme="dark"] .ant-pagination .ant-select-selection-item {
  color: #d6e2f2 !important;
}

/* ---------- 10. 原生 select / 输入控件 ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] select,
html[data-theme="dark"] select option,
html[data-theme="dark"] optgroup {
  background: rgba(15, 23, 38, .96) !important;
  color: #d6e2f2 !important;
  border-color: rgba(96, 165, 250, .22) !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] textarea {
  background: rgba(15, 23, 38, .94) !important;
  color: #e6edf8 !important;
  border-color: rgba(96, 165, 250, .22) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: rgba(178, 196, 218, .48) !important;
}

/* ---------- 11. 页面标题条 rc-header ---------- */
html[data-theme="dark"] .rc-header,
html[data-theme="dark"] .rc-header-elevated {
  background: linear-gradient(120deg, rgba(14, 24, 40, .95) 0%, rgba(9, 16, 28, .95) 100%) !important;
  border-color: rgba(96, 165, 250, .16) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .38) !important;
  color: #e6edf8 !important;
}

html[data-theme="dark"] .rc-header * {
  color: #e6edf8 !important;
}

/* 其它 rc 容器 */
html[data-theme="dark"] .rc-card,
html[data-theme="dark"] .rc-panel,
html[data-theme="dark"] .rc-surface {
  background: rgba(13, 20, 33, .88) !important;
  border-color: rgba(96, 165, 250, .16) !important;
}

/* ---------- 12. 内联 rgb 深色文字提亮（表单标签等，不动预览区） ---------- */
html[data-theme="dark"] [style*="color: rgb(31, 41, 55)"],
html[data-theme="dark"] [style*="color: rgb(30, 41, 59)"],
html[data-theme="dark"] [style*="color: rgb(51, 65, 85)"],
html[data-theme="dark"] [style*="color: rgb(55, 65, 81)"],
html[data-theme="dark"] [style*="color: rgb(71, 85, 105)"],
html[data-theme="dark"] [style*="color: rgb(107, 114, 128)"] {
  color: #c9d7e9 !important;
}

html[data-theme="dark"] [style*="color: rgb(100, 116, 139)"],
html[data-theme="dark"] [style*="color: rgb(148, 163, 184)"] {
  color: #93a6bf !important;
}

/* 白色预览容器里保持原样（手机模拟界面） */
html[data-theme="dark"] [style*="background: rgb(249, 250, 251)"],
html[data-theme="dark"] [style*="background: #f9fafb"],
html[data-theme="dark"] [style*="background: rgb(255, 255, 255)"] {
  background: rgba(15, 23, 38, .94) !important;
}

/* 上传类按钮（透明底暗字） */
html[data-theme="dark"] main button[style*="background: transparent"],
html[data-theme="dark"] main button:not([class]) {
  border-color: rgba(96, 165, 250, .28) !important;
  color: #c9d7e9 !important;
}

/* ---------- 13. 手机端顶栏瘦身 ---------- */
@media (max-width: 640px) {
  .jwh-hide-sm { display: none !important; }
  header { gap: 6px !important; padding: 6px 8px !important; }
}

/* ---------- 14. 禁用按钮 / 分页 / 输入框 ---------- */
html[data-theme="dark"] .ant-btn[disabled],
html[data-theme="dark"] .ant-btn.ant-btn-disabled,
html[data-theme="dark"] button[disabled] {
  background: rgba(148, 163, 184, .10) !important;
  color: #7f8ea6 !important;
  border-color: rgba(148, 163, 184, .18) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .ant-pagination-item,
html[data-theme="dark"] .ant-pagination-prev .ant-pagination-item-link,
html[data-theme="dark"] .ant-pagination-next .ant-pagination-item-link,
html[data-theme="dark"] .ant-pagination-jump-next .ant-pagination-item-link,
html[data-theme="dark"] .ant-pagination-jump-prev .ant-pagination-item-link {
  background: rgba(15, 23, 38, .9) !important;
  border-color: rgba(96, 165, 250, .22) !important;
}
html[data-theme="dark"] .ant-pagination-item a,
html[data-theme="dark"] .ant-pagination-item-link,
html[data-theme="dark"] .ant-pagination-item-link span {
  color: #c9d7e9 !important;
}
html[data-theme="dark"] .ant-pagination-item-active {
  background: rgba(59, 130, 246, .24) !important;
  border-color: rgba(96, 165, 250, .5) !important;
}
html[data-theme="dark"] .ant-input,
html[data-theme="dark"] .ant-input-sm,
html[data-theme="dark"] input.ant-input {
  background: rgba(15, 23, 38, .94) !important;
  color: #e6edf8 !important;
  border-color: rgba(96, 165, 250, .2) !important;
}

/* ---------- 15. Logo 圆章 & 链接提亮 ---------- */
html[data-theme="dark"] img[src*="logo"] {
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .35), 0 0 14px rgba(59, 130, 246, .32) !important;
  background: transparent !important;
}
html[data-theme="dark"] a:not([class*="ant-menu"]):not([class*="ant-btn"]) {
  color: #8ec2ff !important;
}

/* ---------- 16. logo 圆形徽章 ---------- */
html[data-theme="dark"] .jwh-logo {
  border-radius: 50% !important;
  overflow: hidden !important;
  box-shadow: 0 0 0 1px rgba(96, 165, 250, .4), 0 0 16px rgba(59, 130, 246, .4) !important;
}

/* ---------- 17. 品牌 logo 圆章（实际文件 hdkj.png） ---------- */
html[data-theme="dark"] .brand-logo,
html[data-theme="dark"] .brand-logo img,
html[data-theme="dark"] img[src*="hdkj"],
html[data-theme="dark"] img[src*="logo"] {
  border-radius: 50% !important;
}
html[data-theme="dark"] .brand-logo img {
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, .45), 0 0 20px rgba(59, 130, 246, .45) !important;
}
