/**
 * 自定义背景色：覆盖范围对齐深色主题
 * 颜色由 JS 写入：
 *   --app-custom-bg / --app-custom-bg-soft / --app-custom-bg-panel
 *   --app-custom-fg / --app-custom-fg-muted / --app-custom-border
 */
/* 只在 html 上给默认兜底；body 不再重写 --app-custom-bg，否则会盖住 html 内联所选色 */
html.app-custom-bg {
  --app-custom-bg: #5b7c99;
  --app-custom-bg-soft: var(--app-custom-bg);
  --app-custom-bg-panel: var(--app-custom-bg);
  --app-custom-fg: #ffffff;
  --app-custom-fg-muted: rgba(255,255,255,0.78);
  --app-custom-border: #bdbdbd;
  --pan-split-bg: var(--app-custom-bg);
  --pan-result-topbar-bg: var(--app-custom-bg);
  --pan-result-tabs-bg: var(--app-custom-bg);
  --pan-border: 1px solid #bdbdbd;
  --qm-rule: #bdbdbd;
  --yp-rule: #bdbdbd;
}
html.app-custom-bg,
html.app-custom-bg body,
body.app-custom-bg {
  /* soft/panel/split 跟主色；不在此写死 --app-custom-bg */
  --app-custom-bg-soft: var(--app-custom-bg);
  --app-custom-bg-panel: var(--app-custom-bg);
  --pan-split-bg: var(--app-custom-bg);
  --pan-result-topbar-bg: var(--app-custom-bg);
  --pan-result-tabs-bg: var(--app-custom-bg);
  --pan-border: 1px solid #bdbdbd;
  --qm-rule: #bdbdbd;
  --yp-rule: #bdbdbd;
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  color: var(--app-custom-fg, #ffffff) !important;
}

/* 切换瞬间关掉过渡，避免有的区域渐变、有的瞬间跳变 */
html.app-dark-switching,
html.app-dark-switching *,
html.app-dark-switching *::before,
html.app-dark-switching *::after {
  transition: none !important;
  animation: none !important;
}

html.app-custom-bg,
html.app-custom-bg body,
body.app-custom-bg {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
  --pan-split-bg: var(--app-custom-bg);
  --pan-border: 1px solid #bdbdbd;
}

/* ?? ??? / ?? / ??? embed ?? ?? */
body.app-custom-bg .app,
body.app-custom-bg.setup-page,
body.app-custom-bg.setup-page.module-nav-visible,
body.app-custom-bg.setup-page.module-nav-visible .app,
body.app-custom-bg.setup-page .setup-mode-panel,
body.app-custom-bg.setup-page .setup-mode-panel.active,
body.app-custom-bg.setup-page .setup-mode-panel > .setup-card,
body.app-custom-bg.setup-page .setup-card,
body.app-custom-bg.setup-page:not(.module-nav-visible),
body.app-custom-bg.setup-page:not(.module-nav-visible) .setup-mode-panel,
body.app-custom-bg.setup-page:not(.module-nav-visible) .setup-mode-panel.active,
body.app-custom-bg.setup-page:not(.module-nav-visible) .setup-card,
body.app-custom-bg.setup-page .liuren-setup-embed,
body.app-custom-bg.setup-page .qimen-setup-embed,
body.app-custom-bg.setup-page .yinpan-setup-embed,
body.app-custom-bg.setup-page .liuyao-setup-embed,
body.app-custom-bg.setup-page .bazi-setup-embed,
body.app-custom-bg.setup-page .ziwei-setup-embed,
body.app-custom-bg.setup-page .meihua-setup-embed,
body.app-custom-bg .liuren-setup-embed.liuren-has-result,
body.app-custom-bg .qimen-setup-embed.qimen-has-result,
body.app-custom-bg .yinpan-setup-embed.yinpan-has-result,
body.app-custom-bg .liuyao-setup-embed.liuyao-has-result,
body.app-custom-bg .meihua-setup-embed.meihua-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="liuren"] > .setup-card.liuren-setup-embed.liuren-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="qimen"] > .setup-card.qimen-setup-embed.qimen-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="yinpan"] > .setup-card.yinpan-setup-embed.yinpan-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="liuyao"] > .setup-card.liuyao-setup-embed.liuyao-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="meihua"] > .setup-card.meihua-setup-embed.meihua-has-result,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="ziwei"] > .setup-card.ziwei-setup-embed:has(.result-area.show),
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="bazi"] > .bazi-setup-embed:has(.result-area.show),
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="bazi"] > .bazi-setup-embed,
body.app-custom-bg.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="ziwei"] > .setup-card.ziwei-setup-embed {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}

/* ???????? */
body.app-custom-bg.setup-page.app-custom-bg .setup-mode-panel:not([data-mode-panel="liuren"]),
body.app-custom-bg.setup-page.app-custom-bg .setup-mode-panel:not([data-mode-panel="liuren"]) > .setup-card,
body.app-custom-bg.setup-page.app-custom-bg .setup-mode-panel:not([data-mode-panel="bazi"]),
body.app-custom-bg.setup-page.app-custom-bg .setup-mode-panel:not([data-mode-panel="bazi"]) > .setup-card {
  background: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
}

/* ?? ?? ?? */
body.app-custom-bg .setup-page-header,
body.app-custom-bg #setupPageHeader {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-mode-nav-track {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
}
html.app-custom-bg .setup-mode-btn,
body.app-custom-bg .setup-mode-btn,
html.app-custom-bg body.setup-page .setup-mode-btn {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--app-custom-fg-muted) !important;
  -webkit-text-fill-color: var(--app-custom-fg-muted) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html.app-custom-bg .setup-mode-btn:hover,
body.app-custom-bg .setup-mode-btn:hover {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  background: var(--app-custom-btn-bg, var(--app-custom-bg-panel)) !important;
}
/* 选中：对比色反相（跟其它按钮一致），浅底不再写死白字 */
html.app-custom-bg .setup-mode-btn.active,
body.app-custom-bg .setup-mode-btn.active,
html.app-custom-bg body.setup-page .setup-mode-btn.active,
html.app-custom-bg[data-setup-active="liuren"] .setup-mode-btn[data-divination-mode="liuren"],
html.app-custom-bg[data-setup-active="qimen"] .setup-mode-btn[data-divination-mode="qimen"],
html.app-custom-bg[data-setup-active="yinpan"] .setup-mode-btn[data-divination-mode="yinpan"],
html.app-custom-bg[data-setup-active="liuyao"] .setup-mode-btn[data-divination-mode="liuyao"],
html.app-custom-bg[data-setup-active="bazi"] .setup-mode-btn[data-divination-mode="bazi"],
html.app-custom-bg[data-setup-active="ziwei"] .setup-mode-btn[data-divination-mode="ziwei"],
html.app-custom-bg[data-setup-active="meihua"] .setup-mode-btn[data-divination-mode="meihua"] {
  color: var(--app-custom-bg) !important;
  -webkit-text-fill-color: var(--app-custom-bg) !important;
  background: var(--app-custom-fg) !important;
  background-color: var(--app-custom-fg) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
body.app-custom-bg .setup-login-btn,
body.app-custom-bg #setupLoginNav,
body.app-custom-bg .setup-settings-btn {
  background: transparent !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .setup-login-avatar {
  border-color: rgba(255,255,255,.2) !important;
  background: var(--app-custom-bg-panel) !important;
}
body.app-custom-bg .setup-page-settings-pop {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-page-settings-pop .setup-theme-title {
  color: var(--app-custom-fg-muted) !important;
  background: transparent !important;
}
body.app-custom-bg .setup-page-settings-pop .setup-theme-item {
  background: var(--app-custom-bg-panel) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-page-settings-pop .setup-theme-item.active {
  background: var(--app-custom-bg-panel) !important;
  border-color: #888 !important;
  color: #fff !important;
}
body.app-custom-bg .setup-mode-vis-sheet {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-mode-vis-head {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-mode-vis-done {
  background: transparent !important;
  color: #8ab4f8 !important;
  border-color: transparent !important;
}
body.app-custom-bg .setup-mode-vis-item {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-mode-vis-hint {
  color: #999 !important;
}
body.app-custom-bg .setup-mode-vis-sheet .setup-theme-item {
  background: var(--app-custom-bg-panel) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .setup-mode-vis-sheet .setup-theme-item.active {
  background: var(--app-custom-bg-panel) !important;
  border-color: #888 !important;
  color: #fff !important;
}
body.app-custom-bg .setup-avatar-pick {
  background: var(--app-custom-bg-panel) !important;
  border-color: transparent !important;
}
body.app-custom-bg .setup-avatar-pick.active {
  background: var(--app-custom-bg-panel) !important;
  border-color: var(--app-custom-fg-muted) !important;
}

/* ?? ???? / ???? ?? */
body.app-custom-bg .setup-card label,
body.app-custom-bg .setup-card .field-label,
body.app-custom-bg .setup-card .section-title,
body.app-custom-bg .divination-form {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg input,
body.app-custom-bg select,
body.app-custom-bg textarea,
body.app-custom-bg .setup-card input,
body.app-custom-bg .setup-card select,
body.app-custom-bg .setup-card textarea,
body.app-custom-bg .birth-time-field,
body.app-custom-bg .qimen-option-select,
body.app-custom-bg .qimen-ju-select,
body.app-custom-bg .meihua-setup-embed .ctrl-inputs input,
body.app-custom-bg .meihua-setup-embed select,
body.app-custom-bg .time-select-row select,
body.app-custom-bg .ming-row select,
body.app-custom-bg .qimen-location-row select,
body.app-custom-bg .qimen-time-ming-row select,
body.app-custom-bg select option {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
/* 问事输入（排盘页 + 结果页）：跟页面黑底一致 */
body.app-custom-bg .setup-question-input,
body.app-custom-bg input.setup-question-input,
body.app-custom-bg .setup-question-box textarea,
body.app-custom-bg .setup-question-box input,
body.app-custom-bg input[data-setup-question],
body.app-custom-bg textarea[data-setup-question],
body.app-custom-bg .yp-question-input,
body.app-custom-bg .qm-question-input,
body.app-custom-bg .question-input,
body.app-custom-bg .result-question-input,
body.app-custom-bg textarea.yp-question-input,
body.app-custom-bg textarea.qm-question-input,
body.app-custom-bg textarea.question-input,
body.app-custom-bg .yp-question-row .yp-question-input,
body.app-custom-bg .qm-question-row .qm-question-input,
body.app-custom-bg .question-row .question-input,
body.app-custom-bg .question-row .result-question-input,
body.app-custom-bg #yinpan-embed-question,
body.app-custom-bg #qimen-embed-question,
body.app-custom-bg #liuren-embed-question,
body.app-custom-bg #liuyao-infoQuestion,
body.app-custom-bg #meihua-infoQuestion,
body.app-custom-bg #infoQuestion,
body.app-custom-bg #infoShixiang {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: transparent !important;
}
body.app-custom-bg .yp-question-row,
body.app-custom-bg .qm-question-row,
body.app-custom-bg .question-row,
body.app-custom-bg .ask-line {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}
body.app-custom-bg input::placeholder,
body.app-custom-bg textarea::placeholder {
  color: #777 !important;
}
body.app-custom-bg .cast-btn,
body.app-custom-bg button.cast-btn,
body.app-custom-bg #meihua-btnCalc,
body.app-custom-bg .meihua-setup-embed #meihua-btnCalc,
body.app-custom-bg .liuyao-primary-btn,
body.app-custom-bg button.liuyao-primary-btn,
body.app-custom-bg #liuyao-control-panel .liuyao-primary-btn {
  background: var(--app-custom-btn-bg, var(--app-custom-bg-panel)) !important;
  background-color: var(--app-custom-btn-bg, var(--app-custom-bg-panel)) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border: 1px solid #bdbdbd !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .time-tab,
body.app-custom-bg .seg-btn,
body.app-custom-bg .option-chip,
body.app-custom-bg .setup-seg button,
body.app-custom-bg .qimen-option-btn,
body.app-custom-bg .qimen-time-tab,
body.app-custom-bg .liuyao-ctrl-tabs button,
body.app-custom-bg .meihua-setup-embed .ctrl-tabs button,
body.app-custom-bg .palace-tab {
  background: var(--app-custom-btn-bg, var(--app-custom-bg-soft)) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .time-tab.active,
body.app-custom-bg .seg-btn.active,
body.app-custom-bg .option-chip.active,
body.app-custom-bg .setup-seg button.active,
body.app-custom-bg .qimen-option-btn.active,
body.app-custom-bg .qimen-time-tab.active,
body.app-custom-bg .qimen-time-type-box .qimen-option-btn.active,
body.app-custom-bg .liuyao-ctrl-tabs button.active,
body.app-custom-bg .meihua-setup-embed .ctrl-tabs button.active,
body.app-custom-bg .palace-tab.active {
  background: var(--app-custom-fg) !important;
  color: var(--app-custom-bg) !important;
  -webkit-text-fill-color: var(--app-custom-bg) !important;
  border-color: var(--app-custom-fg) !important;
}

body.app-custom-bg #sharedTimeCard,
body.app-custom-bg .shared-time-card {
  background: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .announcement-panel,
body.app-custom-bg .setup-ju-box,
body.app-custom-bg .qimen-time-panel,
body.app-custom-bg .qimen-ju-panel,
body.app-custom-bg .time-select-row,
body.app-custom-bg .setup-row,
body.app-custom-bg .form-row,
body.app-custom-bg .option-row,
body.app-custom-bg #liuyao-control-panel {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}

/* ?? ???? / ???? ?? */
body.app-custom-bg .main-card,
body.app-custom-bg .board-wrap,
body.app-custom-bg .board-wrap .panel,
body.app-custom-bg .compact-view,
body.app-custom-bg .detail-inline-panel,
body.app-custom-bg .pan-result-gap,
body.app-custom-bg .result-area,
body.app-custom-bg .result-card,
body.app-custom-bg .qm-main-card,
body.app-custom-bg .qm-board-wrap,
body.app-custom-bg .yp-main-card,
body.app-custom-bg .yp-board-wrap,
body.app-custom-bg .chart-panel,
body.app-custom-bg #liuren-result-panel,
body.app-custom-bg #qimen-result-panel,
body.app-custom-bg #yinpan-result-panel,
body.app-custom-bg #liuyao-result-panel,
body.app-custom-bg #meihua-result-panel,
body.app-custom-bg .liuyao-result-card,
body.app-custom-bg .liuyao-board-wrap,
body.app-custom-bg .board-slot,
body.app-custom-bg .meihua-setup-embed .card,
body.app-custom-bg .meihua-setup-embed .board-panel,
body.app-custom-bg .meihua-setup-embed .board-wrap,
body.app-custom-bg .meihua-setup-embed.meihua-has-result #meihua-result-panel,
body.app-custom-bg .bazi-setup-embed .result-card,
body.app-custom-bg .bazi-setup-embed .result-area,
body.app-custom-bg .bazi-setup-embed .result-area.show,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .upper-block,
body.app-custom-bg.setup-page.module-nav-visible .bazi-setup-embed .result-card,
body.app-custom-bg.setup-page.module-nav-visible .bazi-setup-embed .result-area.show,
body.app-custom-bg.setup-page.module-nav-visible .bazi-setup-embed .wz-pan-ui,
body.app-custom-bg.setup-page.module-nav-visible .bazi-setup-embed .wz-pan-ui .upper-block,
body.app-custom-bg .ziwei-setup-embed .result-area,
body.app-custom-bg .ziwei-setup-embed .chart-panel,
body.app-custom-bg .ziwei-setup-embed .panel {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
  box-shadow: none !important;
}
body.app-custom-bg .board-wrap::before,
body.app-custom-bg .qm-board-wrap::before,
body.app-custom-bg .yp-board-wrap::before,
body.app-custom-bg .liuren-setup-embed .board-wrap::before,
body.app-custom-bg .liuren-setup-embed.liuren-has-result .board-wrap::before,
body.app-custom-bg .qimen-setup-embed .qm-board-wrap::before,
body.app-custom-bg .yinpan-setup-embed .yp-board-wrap::before,
body.app-custom-bg .liuyao-setup-embed .board-wrap::before,
body.app-custom-bg .pan-result-gap,
html.app-custom-bg .board-wrap::before,
html.app-custom-bg .qm-board-wrap::before,
html.app-custom-bg .yp-board-wrap::before,
html.app-custom-bg .liuren-setup-embed.liuren-has-result .board-wrap::before {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}

/* ?? ?? / ?? / ???? ?? */
body.app-custom-bg .method-tags .tag,
body.app-custom-bg .qm-method-tags .tag,
body.app-custom-bg .yp-method-tags .tag,
body.app-custom-bg .tag,
body.app-custom-bg .tag.gray,
body.app-custom-bg .tag.highlight,
body.app-custom-bg #liuyao-result-panel .tag,
body.app-custom-bg .status-pills .pill {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg-muted) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .method-tags .tag.highlight,
body.app-custom-bg .tag.highlight {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .datetime-line,
body.app-custom-bg .meta-row,
body.app-custom-bg .meta-row span,
body.app-custom-bg .meta-row .value,
body.app-custom-bg .question-row,
body.app-custom-bg .question-row span {
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .pillars .pillar,
body.app-custom-bg .lr-pillar,
body.app-custom-bg .bazi-setup-embed .pillars-container .pillar,
body.app-custom-bg.setup-page.module-nav-visible .bazi-setup-embed .pillars-container .pillar,
body.app-custom-bg .pillars-container .pillar {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .ss-table,
body.app-custom-bg .ss-table th,
body.app-custom-bg .ss-table td {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}

/* ?? ???? / ??? ?? */
body.app-custom-bg .plate,
body.app-custom-bg .plate .cell,
body.app-custom-bg .plate .center,
body.app-custom-bg .plate .center .lesson-col,
body.app-custom-bg .qm-board,
body.app-custom-bg .qm-palace,
body.app-custom-bg .yp-palace,
body.app-custom-bg .palace,
body.app-custom-bg .palace-cell,
body.app-custom-bg .qimen-setup-embed .qm-palace,
body.app-custom-bg .qimen-setup-embed .palace,
body.app-custom-bg .yinpan-setup-embed .palace,
body.app-custom-bg .yinpan-setup-embed #yinpan-embed-board,
body.app-custom-bg .cv-main-grid,
body.app-custom-bg .cv-main-grid .mg-cell,
body.app-custom-bg .cv-main-grid .mg-center {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .cv-main-grid {
  background: var(--app-custom-bg-panel) !important;
}
body.app-custom-bg .qm-board-tools button,
body.app-custom-bg .board-tools button,
body.app-custom-bg .yinpan-setup-embed .qm-board-tools button,
body.app-custom-bg .qimen-setup-embed .qm-board-tools button,
body.app-custom-bg .cv-nav button,
body.app-custom-bg .ly-board-actions button,
body.app-custom-bg .meihua-setup-embed .board-actions .btn,
body.app-custom-bg .detail-tool-btn,
body.app-custom-bg .yao-sy,
body.app-custom-bg .show-note-area button {
  background: var(--app-custom-btn-bg, var(--app-custom-bg-soft)) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .ly-board-actions button.active,
body.app-custom-bg .meihua-setup-embed .board-actions .btn.active,
body.app-custom-bg .detail-tool-btn.active {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg-panel)) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}

/* AI / ??? */
body.app-custom-bg .cv-ai-section,
body.app-custom-bg .ai-section,
body.app-custom-bg .cv-ai-section input,
body.app-custom-bg .cv-ai-section .cv-ai-input-wrap,
body.app-custom-bg .cv-ai-output,
body.app-custom-bg .ai-input-wrap,
body.app-custom-bg .ai-input-wrap input {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .cv-ai-section .cv-ai-label,
body.app-custom-bg .ai-section .ai-label {
  color: var(--app-custom-fg-muted) !important;
}

/* ?? ???? / ?? ?? */
body.app-custom-bg #setupResultTopbar,
body.app-custom-bg .pan-result-topbar,
body.app-custom-bg #resultPageTopbar {
  background: var(--app-custom-bg) !important;
  border-bottom-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
  --pan-result-topbar-bg: var(--app-custom-bg);
  --pan-result-tabs-bg: var(--app-custom-bg);
}
body.app-custom-bg #setupResultTopbar .pan-result-topbar__title,
body.app-custom-bg #setupResultTopbar .topbar-title,
body.app-custom-bg .pan-result-topbar .topbar-title,
body.app-custom-bg #resultPageTopbar .topbar-title,
body.app-custom-bg .pan-result-topbar__title {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg #setupResultTopbar .pan-result-topbar__back,
body.app-custom-bg #setupResultTopbar .back-btn,
body.app-custom-bg #setupResultTopbar .detail-settings-btn,
body.app-custom-bg .pan-result-topbar .back-btn,
body.app-custom-bg .pan-result-topbar .detail-settings-btn {
  background: var(--app-custom-bg-panel) !important;
  border: 1px solid #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg #setupResultTopbar .tab-btn,
body.app-custom-bg .pan-result-topbar .tab-btn {
  background: var(--app-custom-bg-soft) !important;
  border: 1px solid #bdbdbd !important;
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg #setupResultTopbar .tab-btn.active,
body.app-custom-bg .pan-result-topbar .tab-btn.active {
  background: var(--app-custom-bg-panel) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg #setupResultTopbar .result-switch-btn {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  background: transparent !important;
}
body.app-custom-bg #setupResultTopbar .result-switch-btn.active {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .module-bottom-nav,
body.app-custom-bg .module-bottom-nav.module-bottom-nav-result,
body.app-custom-bg .module-bottom-nav.bottom-nav,
body.app-custom-bg .module-bottom-nav-selection {
  background: var(--app-custom-bg) !important;
  border-color: transparent !important;
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .module-bottom-nav .nav-item,
body.app-custom-bg .module-bottom-nav .nav-label {
  color: var(--app-custom-fg-muted) !important;
}

/* 设置弹层：跟黑色主题 */
body.app-custom-bg .detail-settings-pop,
body.app-custom-bg #mpResultSettingsOverlay .mp-result-settings-sheet {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
}
/* —— 深色可读字色：课体解释 / 五行旺衰 —— */
body.app-custom-bg .detail-inline-panel,
body.app-custom-bg .detail-inline-body,
body.app-custom-bg .detail-summary-text,
body.app-custom-bg .detail-meta-card,
body.app-custom-bg .detail-wuxing-section,
body.app-custom-bg .detail-wuxing-section .sec-title,
body.app-custom-bg .cv-ai-output,
body.app-custom-bg .cv-ai-output p,
body.app-custom-bg .cv-ai-output .sec-title,
body.app-custom-bg .ai-output,
body.app-custom-bg .ai-output .sec-title {
  background: var(--app-custom-bg-soft) !important;
  color: #e0e0e0 !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .detail-meta-card .label { color: var(--app-custom-fg-muted) !important; }
body.app-custom-bg .detail-meta-card .value { color: #eaeaea !important; }
body.app-custom-bg .detail-wuxing-table {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  box-shadow: none !important;
}
body.app-custom-bg .detail-wuxing-table th,
body.app-custom-bg .detail-wuxing-table td {
  color: #e0e0e0 !important;
  border-color: #bdbdbd !important;
  background: var(--app-custom-bg-soft) !important;
}
body.app-custom-bg .detail-wuxing-table th,
body.app-custom-bg .detail-wuxing-table .row-label {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .board-title-row h2 {
  color: var(--app-custom-fg) !important;
}

/* —— 奇门 / 阴盘 / 紫微：命理大运流年 —— */
body.app-custom-bg .pan-luck-section.luck-page-card,
body.app-custom-bg .ziwei-luck-section.luck-page-card {
  --zw-luck-ink: #d8e8de;
  --zw-luck-ink-soft: #b8d0c4;
  --zw-luck-line: #bdbdbd;
  --zw-luck-paper: var(--app-custom-bg-soft);
  --zw-luck-selected: #243028;
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: #e0e0e0 !important;
  box-shadow: none !important;
}
body.app-custom-bg .pan-luck-section .row-container,
body.app-custom-bg .ziwei-luck-section .row-container {
  background: var(--app-custom-bg-soft) !important;
  box-shadow: inset 0 0 0 1px #bdbdbd !important;
}
body.app-custom-bg .pan-luck-section .row-title,
body.app-custom-bg .ziwei-luck-section .row-title {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .pan-luck-section .row-title-wrapper,
body.app-custom-bg .ziwei-luck-section .row-title-wrapper {
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .pan-luck-section .row-scroll,
body.app-custom-bg .ziwei-luck-section .row-scroll {
  background: var(--app-custom-bg-soft) !important;
}
body.app-custom-bg .pan-luck-section .row-item,
body.app-custom-bg .ziwei-luck-section .row-item {
  border-right-color: #bdbdbd !important;
  color: #e0e0e0 !important;
}
body.app-custom-bg .pan-luck-section .row-item.selected,
body.app-custom-bg .ziwei-luck-section .row-item.selected {
  background: #243028 !important;
}
body.app-custom-bg .pan-luck-section .row-item-top,
body.app-custom-bg .ziwei-luck-section .row-item-top,
body.app-custom-bg .pan-luck-section .row-item-gz,
body.app-custom-bg .ziwei-luck-section .row-item-gz,
body.app-custom-bg .luck-page-card .row-item-top,
body.app-custom-bg .luck-page-card .row-item-gz,
body.app-custom-bg .luck-page-card .row-item-plain {
  color: #eaeaea !important;
}
body.app-custom-bg .pan-luck-section .row-item-subtop,
body.app-custom-bg .ziwei-luck-section .row-item-subtop,
body.app-custom-bg .pan-luck-section .row-item-ss,
body.app-custom-bg .ziwei-luck-section .row-item-ss,
body.app-custom-bg .pan-luck-section .row-item-bottom,
body.app-custom-bg .ziwei-luck-section .row-item-bottom {
  color: #9aa3ad !important;
}
body.app-custom-bg .luck-page-card .woodColor { color: #3dd68c !important; }
body.app-custom-bg .luck-page-card .fireColor { color: #ff6b6b !important; }
body.app-custom-bg .luck-page-card .soilColor { color: #d4a574 !important; }
body.app-custom-bg .luck-page-card .goldColor { color: #ffd666 !important; }
body.app-custom-bg .luck-page-card .waterColor { color: #6bb3ff !important; }

/* —— 六爻：卦爻与字 —— */
body.app-custom-bg .liuyao-setup-embed,
body.app-custom-bg .liuyao-setup-embed .ly-info-row .v,
body.app-custom-bg .liuyao-setup-embed .info-row .v,
body.app-custom-bg .liuyao-setup-embed .ly-board-head-left,
body.app-custom-bg .liuyao-setup-embed .ly-board-sub,
body.app-custom-bg .liuyao-setup-embed .ly-board-xunkong,
body.app-custom-bg .liuyao-setup-embed .yao-shen,
body.app-custom-bg .liuyao-setup-embed .yao-qin,
body.app-custom-bg .liuyao-setup-embed .yao-fu,
body.app-custom-bg .liuyao-setup-embed .slot-gua,
body.app-custom-bg .liuyao-setup-embed .slot-title,
body.app-custom-bg .liuyao-setup-embed .yao-gz,
body.app-custom-bg .liuyao-setup-embed .yao-gz .t,
body.app-custom-bg .liuyao-setup-embed .yao-gz .z,
body.app-custom-bg .liuyao-setup-embed .ly-legend .black,
body.app-custom-bg .liuyao-setup-embed .legend .black,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-pillars .tg,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-pillars .dz,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-board-sub,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-board-xunkong,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .slot-gua,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .slot-title,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-gz .t,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-gz .z,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-gz .wx,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-sy,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-shen,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-qin,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-fu,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-legend .black,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-legend .gray {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .liuyao-setup-embed .ly-legend .blue,
body.app-custom-bg .liuyao-setup-embed .legend .blue,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-legend .blue,
body.app-custom-bg .liuyao-setup-embed .wx-water,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .wx-water {
  color: #6bb3ff !important;
}
body.app-custom-bg .liuyao-setup-embed .wx-wood,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .wx-wood { color: #3dd68c !important; }
body.app-custom-bg .liuyao-setup-embed .wx-fire,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .wx-fire { color: #ff6b6b !important; }
body.app-custom-bg .liuyao-setup-embed .wx-earth,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .wx-earth { color: #d4a574 !important; }
body.app-custom-bg .liuyao-setup-embed .wx-metal,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .wx-metal { color: #ffd666 !important; }
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-legend .orange,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .ly-legend .red { color: #ff9f6b !important; }
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-line-box.dong::after,
body.app-custom-bg .liuyao-setup-embed.liuyao-simple-mode .yao-line-box.dong-yin::after {
  color: #ffd666 !important;
}
body.app-custom-bg .liuyao-setup-embed .yao-line,
body.app-custom-bg .liuyao-setup-embed .yao-line-box {
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
/* 阴/阳爻同色：浅底深线、深底浅线（跟 --app-custom-fg） */
body.app-custom-bg .liuyao-setup-embed,
body.app-custom-bg #liuyao-result-panel {
  --ly-yang: var(--app-custom-fg);
  --ly-yin: var(--app-custom-fg);
}
body.app-custom-bg .liuyao-setup-embed .yao-line-box.yang .ln,
body.app-custom-bg #liuyao-boards .yao-line-box.yang .ln,
body.app-custom-bg #liuyao-result-panel .yao-line-box.yang .ln {
  background: var(--app-custom-fg) !important;
}
body.app-custom-bg .liuyao-setup-embed .yao-line-box.yin .ln,
body.app-custom-bg #liuyao-boards .yao-line-box.yin .ln,
body.app-custom-bg #liuyao-result-panel .yao-line-box.yin .ln {
  background: var(--app-custom-fg) !important;
  box-shadow: 21px 0 0 var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed {
  --yang: var(--app-custom-fg);
  --yin: var(--app-custom-fg);
  --ink: var(--app-custom-fg);
  --ink2: var(--app-custom-fg-muted);
  --dong-color: #ffb347;
}
body.app-custom-bg .meihua-setup-embed .yao-line-box.yang .ln,
body.app-custom-bg .meihua-setup-embed .boards.compact .yao-line-box.yang .ln,
body.app-custom-bg .meihua-setup-embed .yao-line-box.yin .ln,
body.app-custom-bg .meihua-setup-embed .boards.compact .yao-line-box.yin .ln,
body.app-custom-bg .meihua-setup-embed .meihua-manual-yao-line.yang i,
body.app-custom-bg .meihua-setup-embed .meihua-manual-yao-line.yin i {
  background: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .yao-line-box.yin .ln {
  box-shadow: 21px 0 0 var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .boards.compact .yao-line-box.yin .ln {
  box-shadow: none !important;
}
body.app-custom-bg .meihua-setup-embed .yao-meta,
body.app-custom-bg .meihua-setup-embed .slot-foot,
body.app-custom-bg .meihua-setup-embed .legend {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .boards.compact .yao-line-box.dong .ln,
body.app-custom-bg .meihua-setup-embed .boards.compact .yao-line-box.dong-yin .ln {
  background: #ffb347 !important;
}
body.app-custom-bg .liuyao-setup-embed .yao-line-box.dong::after,
body.app-custom-bg .liuyao-setup-embed .yao-line-box.dong-yin::after,
body.app-custom-bg .meihua-setup-embed .yao-line-box.dong::after,
body.app-custom-bg .meihua-setup-embed .yao-line-box.dong-yin::after {
  color: #ffb347 !important;
}

/* 六爻深色：补全结果区白底遗漏 */
body.app-custom-bg .liuyao-setup-embed .result-area,
body.app-custom-bg .liuyao-setup-embed .ly-board-head,
body.app-custom-bg .liuyao-setup-embed .ly-boards-viewport,
body.app-custom-bg .liuyao-setup-embed .ly-legend,
body.app-custom-bg .liuyao-setup-embed .board-wrap .panel,
body.app-custom-bg .liuyao-setup-embed.liuyao-has-result .board-wrap::before,
body.app-custom-bg #liuyao-result-panel .main-card,
body.app-custom-bg #liuyao-result-panel .liuyao-result-card,
body.app-custom-bg #liuyao-result-panel .liuyao-board-head,
body.app-custom-bg #liuyao-legend,
body.app-custom-bg #liuyao-embed-resultArea,
body.setup-page.app-custom-bg #liuyao-result-panel .board-slot,
body.setup-page.app-custom-bg #liuyao-result-panel .board-wrap,
body.setup-page.app-custom-bg #liuyao-result-panel .board-wrap .panel,
body.setup-page.app-custom-bg #liuyao-boards,
body.setup-page.app-custom-bg #liuyao-boardsViewport,
body.setup-page.app-custom-bg #liuyao-boards .board-slot {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  box-shadow: none !important;
}

/* —— 梅花：卦与字 —— */
body.app-custom-bg .meihua-setup-embed,
body.app-custom-bg .meihua-setup-embed .info-row .v,
body.app-custom-bg .meihua-setup-embed .slot-title,
body.app-custom-bg .meihua-setup-embed .slot-gua,
body.app-custom-bg .meihua-setup-embed .card,
body.app-custom-bg .meihua-setup-embed .result-card,
body.app-custom-bg .meihua-setup-embed .board-panel,
body.app-custom-bg .meihua-setup-embed .legend .black,
body.app-custom-bg .meihua-setup-embed .bagua-cat-item .v {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .info-row span,
body.app-custom-bg .meihua-setup-embed .ctrl-inputs label {
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .meihua-setup-embed .wx-wood { color: #3dd68c !important; }
body.app-custom-bg .meihua-setup-embed .wx-fire { color: #ff6b6b !important; }
body.app-custom-bg .meihua-setup-embed .wx-earth { color: #d4a574 !important; }
body.app-custom-bg .meihua-setup-embed .wx-metal { color: #ffd666 !important; }
body.app-custom-bg .meihua-setup-embed .wx-water { color: #6bb3ff !important; }
body.app-custom-bg .meihua-setup-embed .relation-good { color: #3dd68c !important; }
body.app-custom-bg .meihua-setup-embed .relation-bad { color: #ff6b6b !important; }
body.app-custom-bg .meihua-setup-embed .relation-neutral { color: #d4a574 !important; }
body.app-custom-bg .meihua-setup-embed .legend .blue { color: #6bb3ff !important; }
body.app-custom-bg .meihua-setup-embed .board-slot:not(.ben-slot) .slot-title { color: #5dcea0 !important; }


/* 紫微宫格：深色 */
body.app-custom-bg .ziwei-setup-embed .palace-card,
body.app-custom-bg .ziwei-setup-embed .center-card,
body.app-custom-bg .palace-card,
body.app-custom-bg .center-card {
  background: var(--app-custom-bg-soft) !important;
  background-color: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .palace-name,
body.app-custom-bg .palace-stem,
body.app-custom-bg .palace-branch,
body.app-custom-bg .palace-star-line,
body.app-custom-bg .palace-note-line,
body.app-custom-bg .palace-foot-line,
body.app-custom-bg .palace-meta,
body.app-custom-bg .palace-tags-text,
body.app-custom-bg .center-card,
body.app-custom-bg .center-card * {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .ziwei-setup-embed .chart-grid,
body.app-custom-bg .ziwei-setup-embed .chart-panel,
body.app-custom-bg .ziwei-setup-embed .result-area,
body.app-custom-bg .ziwei-setup-embed .panel,
body.app-custom-bg .ziwei-setup-embed .panel-head,
body.app-custom-bg .ziwei-setup-embed .panel-head h2,
body.app-custom-bg .ziwei-setup-embed .panel-head p {
  background: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .chart-link-line {
  stroke: rgba(200, 200, 200, 0.35) !important;
}

/* —— 去掉杂色字底：统一纯黑/深灰，不要黄/绿/粉/奶白衬底 —— */
body.app-custom-bg .pan-luck-section.luck-page-card,
body.app-custom-bg .ziwei-luck-section.luck-page-card {
  --zw-luck-ink: var(--app-custom-fg);
  --zw-luck-ink-soft: #b0b0b0;
  --zw-luck-line: #bdbdbd;
  --zw-luck-paper: var(--app-custom-bg-soft);
  --zw-luck-selected: #999999;
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: #e0e0e0 !important;
  box-shadow: none !important;
}
body.app-custom-bg .pan-luck-section .row-item.selected,
body.app-custom-bg .ziwei-luck-section .row-item.selected,
body.app-custom-bg .luck-page-card .row-item.selected {
  background: var(--app-custom-bg-panel) !important;
}
body.app-custom-bg .luck-wuxing-item,
body.app-custom-bg .luck-wuxing-item.wx-mu,
body.app-custom-bg .luck-wuxing-item.wx-huo,
body.app-custom-bg .luck-wuxing-item.wx-tu,
body.app-custom-bg .luck-wuxing-item.wx-jin,
body.app-custom-bg .luck-wuxing-item.wx-shui {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: #e0e0e0 !important;
}

body.app-custom-bg .ai-fee-tip,
body.app-custom-bg [data-ai-fee-tip],
body.app-custom-bg #baziAiFeeTip,
body.app-custom-bg .ai-topic-level-card,
body.app-custom-bg .ai-topic-level-card.wealth,
body.app-custom-bg .ai-topic-level-card.study,
body.app-custom-bg .bazi-chat-messages,
body.app-custom-bg .ai-topic-row select,
body.app-custom-bg .ziwei-ai-result,
body.app-custom-bg .qm-ai-result,
body.app-custom-bg .yp-ai-result,
body.app-custom-bg #aiSaveArea,
body.app-custom-bg .classic-rich-section,
body.app-custom-bg .classic-rich-section-title,
body.app-custom-bg .classic-rich-verse,
body.app-custom-bg .bazi-assist-table th,
body.app-custom-bg .bazi-assist-table .rel-tag,
body.app-custom-bg .bazi-assist-table tbody tr:nth-child(even) td,
body.app-custom-bg .wz-pan-ui .scroll-col.active {
  background: var(--app-custom-bg-soft) !important;
  background-image: none !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}

body.app-custom-bg .lr-error,
body.app-custom-bg #liuren-embed-error,
body.app-custom-bg #yinpan-embed-error,
body.app-custom-bg #pan-error {
  background: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  color: #e0e0e0 !important;
}

body.app-custom-bg .cv-top-info .cv-ss-grid .ss-item,
body.app-custom-bg .xiang-chip,
body.app-custom-bg .ss-token {
  background: var(--app-custom-bg-soft) !important;
  background-color: var(--app-custom-bg-soft) !important;
  box-shadow: none !important;
  border-color: #bdbdbd !important;
  color: #e0e0e0 !important;
}

body.app-custom-bg .yao-row.dong,
body.app-custom-bg .meihua-setup-embed .yao-row.dong,
body.app-custom-bg .yao-line-box.dong,
body.app-custom-bg .yao-line-box.dong-yin {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

body.app-custom-bg .time-tabs,
body.app-custom-bg .qimen-time-tabs,
body.app-custom-bg #liuyao-coin-caster.casting,
body.app-custom-bg .ziwei-setup-embed .panel-head,
body.app-custom-bg .vip-option.selected {
  background: var(--app-custom-btn-bg, var(--app-custom-bg-soft)) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}

body.app-custom-bg .palace-card span,
body.app-custom-bg .palace-card p,
body.app-custom-bg .center-card span,
body.app-custom-bg .center-card p,
body.app-custom-bg .plate .cell span,
body.app-custom-bg .cv-main-grid .mg-cell span,
body.app-custom-bg .qm-palace span,
body.app-custom-bg .yp-palace span,
body.app-custom-bg .yao-gz span,
body.app-custom-bg .yao-shen,
body.app-custom-bg .yao-qin,
body.app-custom-bg .yao-fu,
body.app-custom-bg .slot-gua,
body.app-custom-bg .slot-title {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* 深色：底栏胶囊轨道 */
body.app-custom-bg .module-bottom-nav,
body.app-custom-bg .module-bottom-nav.bottom-nav,
body.app-custom-bg .module-bottom-nav.module-bottom-nav-selection,
body.app-custom-bg .module-bottom-nav.module-bottom-nav-result,
body.app-custom-bg .module-bottom-nav.module-bottom-nav-bagua,
body.app-custom-bg .bottom-nav.module-bottom-nav,
body.app-custom-bg.setup-page .module-bottom-nav {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
  border-color: transparent !important;
  color: var(--app-custom-fg-muted) !important;
  box-shadow: none !important;
}
body.app-custom-bg .module-bottom-nav.bottom-nav::before,
body.app-custom-bg .module-bottom-nav::before {
  background: var(--app-custom-bg-soft) !important;
  background-color: var(--app-custom-bg-soft) !important;
  border-color: #bdbdbd !important;
  opacity: 1;
}
body.app-custom-bg .module-bottom-nav .nav-item:not(.is-active):not(.active),
body.app-custom-bg .module-bottom-nav .nav-label,
body.app-custom-bg .module-bottom-nav .nav-item:not(.is-active):not(.active) span {
  background: transparent !important;
  color: var(--app-custom-fg-muted) !important;
  box-shadow: none !important;
}
body.app-custom-bg .module-bottom-nav .nav-item.is-active,
body.app-custom-bg .module-bottom-nav .nav-item.active,
body.app-custom-bg .module-bottom-nav .nav-item:active {
  background: var(--app-custom-bg-panel) !important;
  background-color: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}
body.app-custom-bg .module-bottom-nav .nav-item.is-active .nav-label,
body.app-custom-bg .module-bottom-nav .nav-item.active .nav-label,
body.app-custom-bg .module-bottom-nav .nav-item.is-active span,
body.app-custom-bg .module-bottom-nav .nav-item.active span {
  background: transparent !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .module-bottom-nav .nav-item-settings .nav-settings-fab,
body.app-custom-bg .module-bottom-nav .nav-settings-fab {
  background: var(--app-custom-bg-panel) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}

/* 排盘日期条：底色跟所选自定义色一致 */
html.app-custom-bg #sharedTimeCard,
html.app-custom-bg .shared-time-card,
html.app-custom-bg .shared-time-host,
html.app-custom-bg .shared-time-visible,
html.app-custom-bg .shared-time-slot,
html.app-custom-bg .btp-trigger,
html.app-custom-bg button.btp-trigger,
html.app-custom-bg .btp-birth-time-section,
html.app-custom-bg .setup-head-block .btp-birth-time-section,
body.app-custom-bg #sharedTimeCard,
body.app-custom-bg .shared-time-card,
body.app-custom-bg .shared-time-host,
body.app-custom-bg .shared-time-visible,
body.app-custom-bg .shared-time-slot,
body.app-custom-bg .btp-trigger,
body.app-custom-bg button.btp-trigger,
body.app-custom-bg .btp-birth-time-section,
body.app-custom-bg .setup-head-block .btp-birth-time-section {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
  border-color: #bdbdbd !important;
}
html.app-custom-bg .btp-trigger-label,
html.app-custom-bg .btp-trigger-main,
html.app-custom-bg .btp-trigger-mode,
html.app-custom-bg .btp-trigger-arrow,
html.app-custom-bg .shared-time-heading,
body.app-custom-bg .btp-trigger-label,
body.app-custom-bg .btp-trigger-main,
body.app-custom-bg .btp-trigger-mode,
body.app-custom-bg .btp-trigger-arrow,
body.app-custom-bg .shared-time-heading {
  background: transparent !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}


/* —— 深色：底栏图标只描边 —— */
body.app-custom-bg .module-bottom-nav .nav-icon svg,
body.app-custom-bg .module-bottom-nav .nav-icon svg * {
  fill: none !important;
  stroke: var(--app-custom-fg-muted) !important;
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .module-bottom-nav .nav-item.is-active .nav-icon svg,
body.app-custom-bg .module-bottom-nav .nav-item.active .nav-icon svg,
body.app-custom-bg .module-bottom-nav .nav-item.is-active .nav-icon svg *,
body.app-custom-bg .module-bottom-nav .nav-item.active .nav-icon svg * {
  stroke: var(--app-custom-fg) !important;
  color: var(--app-custom-fg) !important;
  fill: none !important;
}

/* —— 深色：我的管理 / 观星楼 / 笔记 —— */
body.app-custom-bg .page-panel,
body.app-custom-bg #managePanel.page-panel,
body.app-custom-bg #profilePanel.page-panel,
body.app-custom-bg #referralPanel.page-panel,
body.app-custom-bg #treasurePanel.page-panel,
body.app-custom-bg #notesPanel.page-panel,
body.app-custom-bg .manage-page,
body.app-custom-bg .treasure-panel-body,
body.app-custom-bg .page-panel .panel-body {
  background: var(--app-custom-bg) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .page-panel .panel-topbar,
body.app-custom-bg #managePanel .panel-topbar,
body.app-custom-bg #treasurePanel .panel-topbar,
body.app-custom-bg #notesPanel .panel-topbar {
  background: var(--app-custom-bg-soft) !important;
  border-bottom-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .page-panel .panel-topbar .panel-title,
body.app-custom-bg .treasure-hub-heading,
body.app-custom-bg .manage-user-name,
body.app-custom-bg .manage-menu-text,
body.app-custom-bg .treasure-feature-title,
body.app-custom-bg .treasure-card-body {
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .manage-user-sub,
body.app-custom-bg .treasure-feature-desc,
body.app-custom-bg .manage-stats-label {
  color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .manage-vip-card,
body.app-custom-bg .manage-menu-item,
body.app-custom-bg .manage-stats-card,
body.app-custom-bg .treasure-feature-card,
body.app-custom-bg .treasure-grid-item,
body.app-custom-bg .treasure-card,
body.app-custom-bg .treasure-feature-icon,
body.app-custom-bg .manage-menu-icon,
body.app-custom-bg .notes-manage-bar,
body.app-custom-bg .record-list,
body.app-custom-bg .record-item,
body.app-custom-bg .note-card {
  background: var(--app-custom-bg-soft) !important;
  background-image: none !important;
  /* 必须写全 border：基线是 border:none，只改 color 看不见线 */
  border: 1px solid #bdbdbd !important;
  box-shadow: none !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .manage-menu-item,
html.app-custom-bg .manage-menu-item,
html[data-app-bg="custom"] .manage-menu-item {
  border: 1px solid #bdbdbd !important;
  background: var(--app-custom-bg-soft, var(--app-custom-bg)) !important;
  box-shadow: none !important;
}
body.app-custom-bg .manage-menu-icon,
html.app-custom-bg .manage-menu-icon {
  border: 1px solid #bdbdbd !important;
}
body.app-custom-bg .manage-vip-btn,
body.app-custom-bg .treasure-checkin-btn,
body.app-custom-bg .treasure-copy-btn,
body.app-custom-bg .notes-manage-toggle {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .treasure-link-input {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
/* 笔记类目条：跟黑底 */
body.app-custom-bg .notes-mode-nav,
body.app-custom-bg #notesPanel .notes-mode-nav {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  border-bottom-color: #bdbdbd !important;
}
body.app-custom-bg .notes-mode-btn {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #888 !important;
}
body.app-custom-bg .notes-mode-btn:hover {
  color: #ccc !important;
}
body.app-custom-bg .notes-mode-btn.active {
  background: transparent !important;
  color: #fff !important;
}
body.app-custom-bg .record-item {
  border-bottom-color: #bdbdbd !important;
}
body.app-custom-bg .record-item .record-title,
body.app-custom-bg .note-card .note-title {
  color: #eaeaea !important;
}
body.app-custom-bg .record-item .record-time,
body.app-custom-bg .record-item .record-pillars,
body.app-custom-bg .note-card .note-time,
body.app-custom-bg .notes-section-title,
body.app-custom-bg .record-arrow {
  color: var(--app-custom-fg-muted) !important;
}

/* —— 弹窗统一跟黑色主题 —— */
body.app-custom-bg .btp-modal,
body.app-custom-bg .btp-header,
body.app-custom-bg .btp-tabs,
body.app-custom-bg .btp-panel,
body.app-custom-bg .btp-footer,
body.app-custom-bg .note-editor-panel,
body.app-custom-bg .note-editor-head,
body.app-custom-bg .note-editor-body,
body.app-custom-bg .note-editor-foot,
body.app-custom-bg .note-list-panel,
body.app-custom-bg .auth-panel,
body.app-custom-bg .announcement-panel,
body.app-custom-bg .points-panel,
body.app-custom-bg .recharge-panel,
body.app-custom-bg .profile-modal,
body.app-custom-bg .vip-panel,
body.app-custom-bg .xiang-panel,
body.app-custom-bg .wechat-share-guide-panel,
body.app-custom-bg .location-permission-panel,
body.app-custom-bg .palace-modal,
body.app-custom-bg .palace-modal-box,
body.app-custom-bg .bazi-assist-dialog,
body.app-custom-bg .detail-settings-pop,
body.app-custom-bg .topbar-settings-pop,
body.app-custom-bg .liuyao-settings-pop,
body.app-custom-bg #mpResultSettingsSheet,
body.app-custom-bg .mp-result-settings-sheet,
body.app-custom-bg .mp-result-settings-head,
/* 梅花点卦弹窗：灰底（勿用近黑，黑背景下看不见）——见文末覆盖 */
body.app-custom-bg .btp-modal input,
body.app-custom-bg .btp-modal select,
body.app-custom-bg .btp-modal button,
body.app-custom-bg .note-editor-body textarea,
body.app-custom-bg .note-editor-foot button,
body.app-custom-bg .auth-panel input,
body.app-custom-bg .auth-panel button,
body.app-custom-bg .recharge-input,
body.app-custom-bg .profile-input,
body.app-custom-bg .detail-setting-item,
body.app-custom-bg .topbar-setting-item {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .btp-close,
body.app-custom-bg .note-editor-head .ne-close,
body.app-custom-bg .mp-result-settings-close,
body.app-custom-bg .auth-panel .auth-close,
body.app-custom-bg .wechat-share-guide-btn,
body.app-custom-bg .mp-result-settings-title {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .btp-tab.active,
body.app-custom-bg .detail-view-seg.active,
body.app-custom-bg .note-editor-foot .ne-save {
  background: var(--app-custom-bg-panel) !important;
  color: #fff !important;
  border-color: #bdbdbd !important;
}
/* 六爻龟壳弹窗：保持默认外观，不要跟深色主题改色 */

body.app-custom-bg .btp-modal,
body.app-custom-bg .btp-van-picker,
body.app-custom-bg .btp-match-panel,
body.app-custom-bg .btp-pop-row,
body.app-custom-bg .btp-search input,
body.app-custom-bg .btp-col-item {
  background: var(--app-custom-bg-soft) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .btp-tab,
body.app-custom-bg .btp-go,
body.app-custom-bg .btp-confirm,
body.app-custom-bg .btp-match-item,
body.app-custom-bg .btp-pop-cell,
body.app-custom-bg .btp-ball {
  background: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .btp-tab.btp-selected,
body.app-custom-bg .btp-go.btp-on,
body.app-custom-bg .btp-ball.btp-on,
body.app-custom-bg .btp-col-item.btp-selected,
body.app-custom-bg .btp-pop-cell.btp-on {
  background: var(--app-custom-bg-panel) !important;
  color: #fff !important;
  border-color: #bdbdbd !important;
}

body.app-custom-bg #liuyao-boards,
body.app-custom-bg #liuyao-boardsViewport,
body.app-custom-bg #liuyao-boards .board-slot,
body.app-custom-bg #liuyao-boards .ben-slot,
body.app-custom-bg #liuyao-result-panel .board-slot,
body.app-custom-bg #liuyao-result-panel .board-wrap,
body.app-custom-bg #liuyao-result-panel .board-wrap .panel,
body.app-custom-bg #liuyao-boards .yao-sy,
body.app-custom-bg #liuyao-result-panel .yao-sy {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  box-shadow: none !important;
}
body.app-custom-bg #liuyao-boards .board-slot.bian-slot,
body.app-custom-bg #liuyao-result-panel .board-slot.bian-slot {
  background: transparent !important;
}

/* —— 六爻龟壳弹窗：强制保持默认深色外观（覆盖主题通配） —— */
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-mask {
  background: rgba(12, 8, 4, 0.55) !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-box {
  background: #1a1410 !important;
  background-color: #1a1410 !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  border-color: transparent !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45) !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-head {
  background: linear-gradient(180deg, #2a2118 0%, #1a1410 100%) !important;
  background-color: #1a1410 !important;
  border-bottom: 1px solid rgba(201, 162, 99, 0.28) !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-body,
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-foot {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-title,
body.app-custom-bg #liuyao-coinModal .ly-shell-hint,
body.app-custom-bg #liuyao-coinModal .ly-coin-status,
body.app-custom-bg #liuyao-coinModal .ly-coin-progress-row,
body.app-custom-bg #liuyao-coinModal .ly-coin-progress-row span,
body.app-custom-bg #liuyao-coinModal .ly-coin-progress-row strong,
body.app-custom-bg #liuyao-coinModal #liuyao-coin-next {
  background: transparent !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-close,
body.app-custom-bg #liuyao-coinModal .ly-coin-modal-foot button,
body.app-custom-bg #liuyao-coinModal .liuyao-coin-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: rgba(201, 162, 99, 0.35) !important;
  box-shadow: none !important;
}
body.app-custom-bg #liuyao-coinModal .ly-shell-stage,
html.app-custom-bg #liuyao-coinModal .ly-shell-stage {
  background: #000 !important;
  background-color: #000 !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 99, 0.22) !important;
}
body.app-custom-bg #liuyao-coinModal .ly-shell-bg,
html.app-custom-bg #liuyao-coinModal .ly-shell-bg {
  background-color: transparent !important;
  background-image: url('/assets/liuyao/coins/shell-hands-back-horizontal.png?v=3') !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}
body.app-custom-bg #liuyao-coinModal .ly-coin-yao-strip,
body.app-custom-bg #liuyao-coinModal .ly-coin-yao-strip * {
  background: transparent !important;
  color: #d7b778 !important;
  -webkit-text-fill-color: #d7b778 !important;
  box-shadow: none !important;
}
body.app-custom-bg #liuyao-coinModal img,
body.app-custom-bg #liuyao-coinModal .coin-face {
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

/* —— 梅花点卦弹窗：底/字随自定义深浅对比 —— */
body.app-custom-bg #meihua-baguaModal .bagua-modal-box,
body.app-custom-bg #meihua-baguaModal .bagua-modal-head,
body.app-custom-bg #meihua-baguaModal .bagua-modal-body,
body.app-custom-bg .meihua-setup-embed .bagua-modal-box {
  background: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-modal-head {
  border-bottom-color: #bdbdbd !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-modal-title,
body.app-custom-bg #meihua-baguaModal .bagua-modal-body,
body.app-custom-bg #meihua-baguaModal .bagua-cat-item .v {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-modal-intro {
  color: var(--app-custom-fg-muted) !important;
  -webkit-text-fill-color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-cat-item {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-cat-item .k {
  color: #c48a3a !important;
  -webkit-text-fill-color: #c48a3a !important;
}
body.app-custom-bg #meihua-baguaModal .bagua-modal-close,
body.app-custom-bg #meihua-baguaModal .bagua-modal-title .wx-tag {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg #meihua-baguaModal .wx-wood { color: #3dd68c !important; -webkit-text-fill-color: #3dd68c !important; }
body.app-custom-bg #meihua-baguaModal .wx-fire { color: #ff6b6b !important; -webkit-text-fill-color: #ff6b6b !important; }
body.app-custom-bg #meihua-baguaModal .wx-earth { color: #d4a574 !important; -webkit-text-fill-color: #d4a574 !important; }
body.app-custom-bg #meihua-baguaModal .wx-metal { color: #ffd666 !important; -webkit-text-fill-color: #ffd666 !important; }
body.app-custom-bg #meihua-baguaModal .wx-water { color: #6bb3ff !important; -webkit-text-fill-color: #6bb3ff !important; }

/* —— 点宫/取象弹窗：底/字跟对比色 —— */
body.app-custom-bg .xiang-panel,
body.app-custom-bg .palace-modal,
body.app-custom-bg .palace-modal-box {
  background: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}
body.app-custom-bg .xiang-head {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  border-bottom-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .xiang-title,
body.app-custom-bg .xiang-body,
body.app-custom-bg .palace-modal-body,
body.app-custom-bg .palace-modal-body .section,
body.app-custom-bg .palace-modal-body .xiangyi-cat,
body.app-custom-bg .palace-modal-body .xiangyi-text,
body.app-custom-bg .palace-modal-body .ai-result,
body.app-custom-bg .palace-modal-body .kv,
body.app-custom-bg .xiang-section,
body.app-custom-bg .xiang-section h4,
body.app-custom-bg .xiang-chip {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .palace-modal-body .section {
  border-bottom-color: #bdbdbd !important;
}
body.app-custom-bg .xiang-chip .k,
body.app-custom-bg .palace-modal-body .ai-loading {
  color: var(--app-custom-fg-muted) !important;
  -webkit-text-fill-color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg .xiang-close {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .palace-modal-body .xiangyi-block,
body.app-custom-bg .palace-modal-body .ai-box,
body.app-custom-bg .xiang-chip {
  background: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg-active, var(--app-custom-bg)) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
body.app-custom-bg .palace-modal-body .ai-error {
  color: #ff6b6b !important;
  -webkit-text-fill-color: #ff6b6b !important;
}

/* 梅花卦辞爻辞行：背景随自定义深浅微调 */
body.app-custom-bg .meihua-setup-embed .board-actions,
body.app-custom-bg .meihua-setup-embed .board-panel .board-actions,
body.app-custom-bg .meihua-setup-embed #meihua-result-inner .board-actions {
  background: var(--app-custom-btn-bg) !important;
  background-color: var(--app-custom-btn-bg) !important;
  border-color: #bdbdbd !important;
}
body.app-custom-bg .meihua-setup-embed .board-actions .btn,
body.app-custom-bg .meihua-setup-embed #meihua-result-inner .board-actions .btn,
body.app-custom-bg .meihua-setup-embed .board-panel .board-actions .btn,
body.app-custom-bg .meihua-setup-embed #meihua-result-inner .board-panel .board-actions .btn,
body.app-custom-bg .liuyao-setup-embed .ly-board-actions button,
body.app-custom-bg .ly-board-actions button {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .board-actions .btn.active,
body.app-custom-bg .meihua-setup-embed #meihua-result-inner .board-actions .btn.active,
body.app-custom-bg .meihua-setup-embed .board-panel .board-actions .btn.active,
body.app-custom-bg .meihua-setup-embed #meihua-result-inner .board-panel .board-actions .btn.active,
body.app-custom-bg .liuyao-setup-embed .ly-board-actions button.active,
body.app-custom-bg .ly-board-actions button.active {
  background: var(--app-custom-btn-bg-active) !important;
  background-color: var(--app-custom-btn-bg-active) !important;
  border-color: #bdbdbd !important;
  border-bottom: 2px solid var(--app-custom-fg) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
/* 六爻点开详情框：灰底可读 */
body.app-custom-bg #liuyao-board-detail,
body.app-custom-bg .liuyao-setup-embed .ly-board-detail,
body.app-custom-bg .ly-board-detail {
  background: #cfcfcf !important;
  background-color: #cfcfcf !important;
  color: var(--app-custom-bg-soft) !important;
  border-color: var(--app-custom-fg-muted) !important;
}
body.app-custom-bg #liuyao-board-detail *,
body.app-custom-bg .liuyao-setup-embed .ly-board-detail * {
  color: var(--app-custom-bg-soft) !important;
}

/* 梅花卦辞爻辞正文：跟对比色；动爻保持橙色 */
body.app-custom-bg .meihua-setup-embed .board-detail,
body.app-custom-bg .meihua-setup-embed #meihua-boardDetail,
body.app-custom-bg .meihua-setup-embed .board-detail-title,
body.app-custom-bg .meihua-setup-embed .gua-ci-name,
body.app-custom-bg .meihua-setup-embed .ci-block,
body.app-custom-bg .meihua-setup-embed .ci-label,
body.app-custom-bg .meihua-setup-embed .ci-yao,
body.app-custom-bg .meihua-setup-embed .ci-extra,
body.app-custom-bg .meihua-setup-embed .detail-block,
body.app-custom-bg .meihua-setup-embed .detail-block h5 {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .ci-block,
body.app-custom-bg .meihua-setup-embed .ci-extra,
body.app-custom-bg .meihua-setup-embed .detail-block + .detail-block {
  border-color: #bdbdbd !important;
}
body.app-custom-bg .meihua-setup-embed .ci-yao.dong,
body.app-custom-bg .meihua-setup-embed .ci-yao.dong .ci-label,
body.app-custom-bg .meihua-setup-embed .legend .dong,
body.app-custom-bg .meihua-setup-embed .legend .orange,
body.app-custom-bg .meihua-setup-embed .board-slot.ben-slot .slot-title,
body.app-custom-bg .meihua-setup-embed .ci-subtabs .btn.active {
  color: #dd6b20 !important;
  -webkit-text-fill-color: #dd6b20 !important;
}
body.app-custom-bg .meihua-setup-embed .ci-yao.dong {
  background: rgba(221, 107, 32, 0.16) !important;
}
body.app-custom-bg .meihua-setup-embed .ci-subtabs .btn {
  background: var(--app-custom-btn-bg) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
body.app-custom-bg .meihua-setup-embed .ci-subtabs .btn.active {
  background: var(--app-custom-btn-bg-active) !important;
  border-color: #dd6b20 !important;
}


/* ===== 自定义主题：压过 embed/kernel 晚加载 #fff !important ===== */
html.app-custom-bg body.setup-page #setupResultTopbar,
html.app-custom-bg body.setup-page #setupResultTopbar.has-bazi-tabs,
html.app-custom-bg body.setup-page #setupResultTopbar .pan-result-topbar__tabs,
html.app-custom-bg body.setup-page #setupResultTopbarTabs,
html.app-custom-bg body.setup-page #setupBaziResultSwitcher,
html.app-custom-bg body.setup-page .pan-result-topbar,
html.app-custom-bg body.setup-page:not(.bazi-dark-bg):has(.bazi-setup-embed .result-area.show) #setupResultTopbar .pan-result-topbar__tabs,
html.app-custom-bg body.setup-page:not(.bazi-dark-bg).module-nav-visible #setupResultTopbar.has-bazi-tabs .pan-result-topbar__tabs,
html.app-custom-bg body.setup-page .app,
html.app-custom-bg body.setup-page .setup-mode-panel,
html.app-custom-bg body.setup-page .setup-mode-panel.active,
html.app-custom-bg body.setup-page .setup-card,
html.app-custom-bg body.setup-page .setup-page-header,
html.app-custom-bg body.setup-page #setupPageHeader,
html.app-custom-bg body .liuren-setup-embed,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result #liuren-result-panel,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .main-card,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .compact-view,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .result-area,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .board-wrap,
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .board-wrap .panel,
html.app-custom-bg body .qimen-setup-embed,
html.app-custom-bg body .qimen-setup-embed.qimen-has-result,
html.app-custom-bg body .qimen-setup-embed .qm-main-card,
html.app-custom-bg body .qimen-setup-embed .qm-board-wrap,
html.app-custom-bg body .qimen-setup-embed .qm-board,
html.app-custom-bg body .qimen-setup-embed .qm-palace,
html.app-custom-bg body .qimen-setup-embed .palace,
html.app-custom-bg body .yinpan-setup-embed,
html.app-custom-bg body .yinpan-setup-embed.yinpan-has-result,
html.app-custom-bg body .yinpan-setup-embed .yp-main-card,
html.app-custom-bg body .yinpan-setup-embed .yp-board-wrap,
html.app-custom-bg body .yinpan-setup-embed #yinpan-embed-board,
html.app-custom-bg body .yinpan-setup-embed .palace,
html.app-custom-bg body .liuyao-setup-embed,
html.app-custom-bg body .liuyao-setup-embed.liuyao-has-result,
html.app-custom-bg body.setup-page #liuyao-result-panel,
html.app-custom-bg body.setup-page #liuyao-boards,
html.app-custom-bg body.setup-page #liuyao-boardsViewport,
html.app-custom-bg body.setup-page #liuyao-board-detail,
html.app-custom-bg body.setup-page #liuyao-legend,
html.app-custom-bg body.setup-page .liuyao-setup-embed .main-card,
html.app-custom-bg body.setup-page .liuyao-setup-embed .board-wrap,
html.app-custom-bg body.setup-page .liuyao-setup-embed .board-slot,
html.app-custom-bg body.setup-page .liuyao-setup-embed .ly-boards,
html.app-custom-bg body.setup-page .liuyao-setup-embed .ly-boards-viewport,
html.app-custom-bg body .meihua-setup-embed,
html.app-custom-bg body .meihua-setup-embed.meihua-has-result,
html.app-custom-bg body .meihua-setup-embed .main-card,
html.app-custom-bg body .meihua-setup-embed .board-wrap,
html.app-custom-bg body .meihua-setup-embed .result-area,
html.app-custom-bg body .ziwei-setup-embed,
html.app-custom-bg body .ziwei-setup-embed .result-area,
html.app-custom-bg body .ziwei-setup-embed .chart-panel,
html.app-custom-bg body .ziwei-setup-embed .chart-grid,
html.app-custom-bg body .ziwei-setup-embed .palace-card,
html.app-custom-bg body .ziwei-setup-embed .center-card,
html.app-custom-bg body .ziwei-setup-embed .panel,
html.app-custom-bg body .bazi-setup-embed,
html.app-custom-bg body.setup-page .bazi-setup-embed .result-card,
html.app-custom-bg body.setup-page .bazi-setup-embed .result-card.detail-page-card,
html.app-custom-bg body.setup-page .bazi-setup-embed .result-area,
html.app-custom-bg body.setup-page .bazi-setup-embed .result-area.show,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .upper-block,
html.app-custom-bg body.setup-page .bazi-setup-embed .pillars-container .pillar,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui table.bazi,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui table.bazi .lab,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui table.bazi thead th,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui table.bazi td,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .birth-info,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .fortune-meta,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .scroll-section,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .scroll-body,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .scroll-row,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .scroll-label,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .scroll-col,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .wz-xiaoyun-bar,
html.app-custom-bg body.setup-page .bazi-setup-embed .wz-pan-ui .wz-pan-tips,
html.app-custom-bg body.setup-page .bazi-setup-embed .gztipsbox,
html.app-custom-bg body.setup-page .bazi-setup-embed .gztipsheader,
html.app-custom-bg body.setup-page .bazi-setup-embed .detail-table-wrap,
html.app-custom-bg body.setup-page .bazi-setup-embed .ai-output-box,
html.app-custom-bg body.setup-page .bazi-setup-embed .bazi-chat-panel,
html.app-custom-bg body.setup-page .bazi-setup-embed .avatar-box-wrapper,
html.app-custom-bg body.setup-page .bazi-setup-embed .detail-info-box,
html.app-custom-bg body.setup-page .bazi-setup-embed .wuxing-info,
html.app-custom-bg body.setup-page .bazi-setup-embed .wuxing-item,
html.app-custom-bg body.setup-page .bazi-setup-embed .result-switcher,
html.app-custom-bg body.setup-page .bazi-setup-embed .relation-box,
html.app-custom-bg body.setup-page .bazi-setup-embed .dayun-item,
html.app-custom-bg body.setup-page .bazi-setup-embed .liunian-item,
html.app-custom-bg body.setup-page .bazi-setup-embed .liuyue-item,
html.app-custom-bg body.setup-page .bazi-setup-embed #resultPageBasic .result-card,
html.app-custom-bg body .main-card,
html.app-custom-bg body .board-wrap,
html.app-custom-bg body .board-wrap .panel,
html.app-custom-bg body .compact-view,
html.app-custom-bg body .result-area,
html.app-custom-bg body .result-card,
html.app-custom-bg body .plate,
html.app-custom-bg body .plate .cell,
html.app-custom-bg body .cv-main-grid,
html.app-custom-bg body .cv-main-grid .mg-cell,
html.app-custom-bg body .cv-main-grid .mg-center,
html.app-custom-bg body #sharedTimeCard,
html.app-custom-bg body .shared-time-card,
html.app-custom-bg body .shared-time-host,
html.app-custom-bg body .shared-time-slot,
html.app-custom-bg body .btp-trigger,
html.app-custom-bg body .module-bottom-nav,
html.app-custom-bg body .module-bottom-nav.bottom-nav,
html.app-custom-bg body .detail-settings-pop,
html.app-custom-bg body #mpResultSettingsSheet,
html.app-custom-bg body .mp-result-settings-sheet,
html.app-custom-bg body .mp-result-settings-head,
html.app-custom-bg body .mp-result-settings-body .detail-setting-item,
html.app-custom-bg body .mp-result-settings-body .detail-setting-view-row,
html.app-custom-bg body .note-editor-panel,
html.app-custom-bg body .setup-mode-vis-sheet,
html.app-custom-bg body .setup-page-settings-pop,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="liuren"] > .setup-card.liuren-setup-embed.liuren-has-result,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="qimen"] > .setup-card.qimen-setup-embed.qimen-has-result,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="yinpan"] > .setup-card.yinpan-setup-embed.yinpan-has-result,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="liuyao"] > .setup-card.liuyao-setup-embed.liuyao-has-result,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="meihua"] > .setup-card.meihua-setup-embed.meihua-has-result,
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="ziwei"] > .setup-card.ziwei-setup-embed:has(.result-area.show),
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="bazi"] > .bazi-setup-embed:has(.result-area.show),
html.app-custom-bg body.setup-page.module-nav-visible .setup-mode-panel[data-mode-panel="bazi"] > .bazi-setup-embed {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
}

html.app-custom-bg body .liuren-setup-embed.liuren-has-result .board-wrap::before,
html.app-custom-bg body .qimen-setup-embed .qm-board-wrap::before,
html.app-custom-bg body .yinpan-setup-embed .yp-board-wrap::before,
html.app-custom-bg body .board-wrap::before {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
}

/* 表单控件 / 选项按钮：用 soft，避免刺眼纯底 */
html.app-custom-bg body.setup-page .setup-question-input,
html.app-custom-bg body.setup-page .setup-question-box textarea,
html.app-custom-bg body.setup-page .setup-question-box input,
html.app-custom-bg body.setup-page input[data-setup-question],
html.app-custom-bg body.setup-page textarea[data-setup-question],
html.app-custom-bg body.setup-page .yp-question-input,
html.app-custom-bg body.setup-page .qm-question-input,
html.app-custom-bg body.setup-page .question-input,
html.app-custom-bg body.setup-page .announcement-panel,
html.app-custom-bg body.setup-page .divination-form,
html.app-custom-bg body.setup-page .setup-section,
html.app-custom-bg body.setup-page .qimen-time-ming-row,
html.app-custom-bg body.setup-page .qimen-time-type-box,
html.app-custom-bg body.setup-page .setup-question-box,
html.app-custom-bg body.setup-page .setup-question-inline-row {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
/* 排盘页按钮/选择控件：用按钮底，不要跟页面同色融在一起 */
html.app-custom-bg body.setup-page .qimen-option-btn,
html.app-custom-bg body.setup-page button.qimen-option-btn,
html.app-custom-bg body.setup-page .cast-btn,
html.app-custom-bg body.setup-page button.cast-btn,
html.app-custom-bg body.setup-page .liuyao-primary-btn,
html.app-custom-bg body.setup-page button.liuyao-primary-btn,
html.app-custom-bg body.setup-page .liuyao-ctrl-tabs button,
html.app-custom-bg body.setup-page #liuyao-control-panel .liuyao-primary-btn,
html.app-custom-bg body.setup-page .qm-board-tools button,
html.app-custom-bg body.setup-page .board-tools button,
html.app-custom-bg body.setup-page select,
html.app-custom-bg body.setup-page .setup-card select,
html.app-custom-bg body.setup-page .time-select-row select,
html.app-custom-bg body.setup-page .ming-row select,
html.app-custom-bg body.setup-page .qimen-option-select,
html.app-custom-bg body.setup-page .qimen-ju-select,
html.app-custom-bg body.setup-page .time-tab,
html.app-custom-bg body.setup-page .seg-btn,
html.app-custom-bg body.setup-page .option-chip,
html.app-custom-bg body.setup-page .setup-seg button,
html.app-custom-bg body.setup-page .gender-option,
html.app-custom-bg body.setup-page .option-item {
  background: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  background-color: var(--app-custom-btn-bg, var(--app-custom-bg)) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}
html.app-custom-bg body.setup-page .time-tab.active,
html.app-custom-bg body.setup-page .seg-btn.active,
html.app-custom-bg body.setup-page .option-chip.active,
html.app-custom-bg body.setup-page .setup-seg button.active,
html.app-custom-bg body.setup-page .qimen-option-btn.active,
html.app-custom-bg body.setup-page .gender-option.active,
html.app-custom-bg body.setup-page .option-item.active {
  background: var(--app-custom-fg) !important;
  background-color: var(--app-custom-fg) !important;
  color: var(--app-custom-bg) !important;
  -webkit-text-fill-color: var(--app-custom-bg) !important;
  border-color: var(--app-custom-fg) !important;
}

/* 宫格/格子：与所选主色完全一致（对齐深色整盘同色） */
html.app-custom-bg body .qimen-setup-embed .qm-palace,
html.app-custom-bg body .qimen-setup-embed .palace,
html.app-custom-bg body .yinpan-setup-embed .palace,
html.app-custom-bg body .ziwei-setup-embed .palace-card,
html.app-custom-bg body .ziwei-setup-embed .center-card,
html.app-custom-bg body .plate .cell,
html.app-custom-bg body .plate .center,
html.app-custom-bg body .cv-main-grid,
html.app-custom-bg body .cv-main-grid .mg-cell,
html.app-custom-bg body .cv-main-grid .mg-center,
html.app-custom-bg body .qm-board,
html.app-custom-bg body .qm-board-wrap,
html.app-custom-bg body .yp-board-wrap,
html.app-custom-bg body .board-wrap,
html.app-custom-bg body .board-wrap .panel,
html.app-custom-bg body .main-card,
html.app-custom-bg body .compact-view {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}

/* 通杀：自定义主题下仍写死白底的内联/样式 */
html.app-custom-bg body.setup-page [style*="background: #fff"],
html.app-custom-bg body.setup-page [style*="background:#fff"],
html.app-custom-bg body.setup-page [style*="background: #ffffff"],
html.app-custom-bg body.setup-page [style*="background:#ffffff"],
html.app-custom-bg body.setup-page [style*="background-color: #fff"],
html.app-custom-bg body.setup-page [style*="background-color:#fff"],
html.app-custom-bg body.setup-page [style*="background-color: #ffffff"],
html.app-custom-bg body.setup-page [style*="background-color:#ffffff"],
html.app-custom-bg body.setup-page [style*="background: rgb(255, 255, 255)"],
html.app-custom-bg body.setup-page [style*="background:rgb(255,255,255)"],
html.app-custom-bg body.setup-page [style*="background-color: rgb(255, 255, 255)"],
html.app-custom-bg body.setup-page [style*="background-color:rgb(255,255,255)"] {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}

/* ===== 自定义排盘：主色锁定（选什么就是什么） ===== */
html.app-custom-bg,
html.app-custom-bg body,
body.app-custom-bg {
  --app-custom-bg-soft: var(--app-custom-bg) !important;
  --app-custom-bg-panel: var(--app-custom-bg) !important;
  --pan-split-bg: var(--app-custom-bg) !important;
  --pan-result-topbar-bg: var(--app-custom-bg) !important;
  --pan-result-tabs-bg: var(--app-custom-bg) !important;
}

html.app-custom-bg .plate,
html.app-custom-bg .plate .cell,
html.app-custom-bg .plate .center,
html.app-custom-bg .plate .center .lesson-col,
html.app-custom-bg .qm-board,
html.app-custom-bg .qm-palace,
html.app-custom-bg .yp-palace,
html.app-custom-bg .palace,
html.app-custom-bg .palace-cell,
html.app-custom-bg .palace-card,
html.app-custom-bg .center-card,
html.app-custom-bg .qimen-setup-embed .qm-palace,
html.app-custom-bg .qimen-setup-embed .palace,
html.app-custom-bg .qimen-setup-embed .qm-board,
html.app-custom-bg .qimen-setup-embed .qm-board-wrap,
html.app-custom-bg .qimen-setup-embed .qm-main-card,
html.app-custom-bg .yinpan-setup-embed .palace,
html.app-custom-bg .yinpan-setup-embed #yinpan-embed-board,
html.app-custom-bg .yinpan-setup-embed .yp-board-wrap,
html.app-custom-bg .yinpan-setup-embed .yp-main-card,
html.app-custom-bg .cv-main-grid,
html.app-custom-bg .cv-main-grid .mg-cell,
html.app-custom-bg .cv-main-grid .mg-center,
html.app-custom-bg .board-wrap,
html.app-custom-bg .board-wrap .panel,
html.app-custom-bg .board-wrap::before,
html.app-custom-bg .qm-board-wrap::before,
html.app-custom-bg .yp-board-wrap::before,
html.app-custom-bg .main-card,
html.app-custom-bg .compact-view,
html.app-custom-bg .result-area,
html.app-custom-bg .result-card,
html.app-custom-bg .liuren-setup-embed.liuren-has-result,
html.app-custom-bg .liuren-setup-embed.liuren-has-result #liuren-result-panel,
html.app-custom-bg .qimen-setup-embed.qimen-has-result,
html.app-custom-bg .yinpan-setup-embed.yinpan-has-result,
html.app-custom-bg .liuyao-setup-embed.liuyao-has-result,
html.app-custom-bg .meihua-setup-embed.meihua-has-result,
html.app-custom-bg .ziwei-setup-embed .chart-panel,
html.app-custom-bg .ziwei-setup-embed .chart-grid,
html.app-custom-bg .ziwei-setup-embed .palace-card,
html.app-custom-bg .ziwei-setup-embed .center-card,
html.app-custom-bg .bazi-setup-embed .result-card,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .upper-block,
html.app-custom-bg .bazi-setup-embed .pillars-container .pillar,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-section,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-body,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-row,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col,
html.app-custom-bg #liuyao-result-panel,
html.app-custom-bg #liuyao-boards,
html.app-custom-bg #liuyao-boardsViewport,
html.app-custom-bg #liuyao-board-detail,
html.app-custom-bg .board-slot,
html.app-custom-bg .ly-boards-viewport {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
}

/* ===== 自定义边框：默认白/灰风格灰线 ===== */
html.app-custom-bg,
html.app-custom-bg body,
body.app-custom-bg {
  --app-custom-border: #bdbdbd !important;
  --pan-border: 1px solid #bdbdbd !important;
  --qm-rule: #bdbdbd !important;
  --yp-rule: #bdbdbd !important;
}

/* 排盘格子 / 盘框：保留可见灰线（底色仍是所选自定义色） */
html.app-custom-bg .plate,
html.app-custom-bg .plate .cell,
html.app-custom-bg .plate .center,
html.app-custom-bg .qm-board,
html.app-custom-bg .qm-palace,
html.app-custom-bg .yp-palace,
html.app-custom-bg .palace,
html.app-custom-bg .palace-cell,
html.app-custom-bg .palace-card,
html.app-custom-bg .center-card,
html.app-custom-bg .qimen-setup-embed .qm-palace,
html.app-custom-bg .qimen-setup-embed .palace,
html.app-custom-bg .qimen-setup-embed .qm-board,
html.app-custom-bg .qimen-setup-embed .qm-board-wrap,
html.app-custom-bg .yinpan-setup-embed .palace,
html.app-custom-bg .yinpan-setup-embed #yinpan-embed-board,
html.app-custom-bg .yinpan-setup-embed .yp-board-wrap,
html.app-custom-bg .cv-main-grid,
html.app-custom-bg .cv-main-grid .mg-cell,
html.app-custom-bg .cv-main-grid .mg-center,
html.app-custom-bg .board-wrap,
html.app-custom-bg .board-wrap .panel,
html.app-custom-bg .main-card,
html.app-custom-bg .compact-view,
html.app-custom-bg .ziwei-setup-embed .palace-card,
html.app-custom-bg .ziwei-setup-embed .center-card,
html.app-custom-bg .ziwei-setup-embed .chart-grid,
html.app-custom-bg .liuyao-setup-embed .board-wrap,
html.app-custom-bg .liuyao-setup-embed .board-slot,
html.app-custom-bg .meihua-setup-embed .board-wrap,
html.app-custom-bg .meihua-setup-embed .board-slot,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi th,
html.app-custom-bg .bazi-setup-embed .pillars-container .pillar {
  border-color: #bdbdbd !important;
}

/* 奇门/阴盘：保持右下描边，不要写成四边全 border（会叠粗） */
html.app-custom-bg .qimen-setup-embed .qm-board {
  border: 1px solid #d4d4d4 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
}
html.app-custom-bg .qimen-setup-embed .qm-palace,
html.app-custom-bg .yinpan-setup-embed .palace {
  border: none !important;
  border-right: 1px solid #d4d4d4 !important;
  border-bottom: 1px solid #d4d4d4 !important;
}

html.app-custom-bg .qm-board-wrap,
html.app-custom-bg .yp-board-wrap,
html.app-custom-bg .board-wrap {
  border-color: #d4d4d4 !important;
  border-top-color: transparent !important; /* 保持原 board-wrap 无顶边 */
}

/*
 * 大六壬十二宫：巳/申/寅/亥四角
 * 问题：外框圆角 + 格子四边描边叠线，角宫看起来更粗。
 * 做法：外框只留 1px；宫与宫之间用 gap；四角宫补圆角贴齐外框。
 */
html.app-custom-bg .liuren-setup-embed .plate,
html.app-custom-bg #liuren-embed-plate.plate,
body.app-custom-bg .liuren-setup-embed .plate,
body.app-custom-bg #liuren-embed-plate.plate {
  border: 1px solid #d4d4d4 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: none !important;
  padding: 0 !important; /* 不能用 padding 当边框，圆角处会显厚 */
  gap: 1px !important;
  background: #d4d4d4 !important; /* 仅作宫间分隔线色 */
  background-color: #d4d4d4 !important;
}

html.app-custom-bg .liuren-setup-embed .plate .cell,
html.app-custom-bg .liuren-setup-embed .plate .center,
html.app-custom-bg #liuren-embed-plate .cell,
html.app-custom-bg #liuren-embed-plate .center,
body.app-custom-bg .liuren-setup-embed .plate .cell,
body.app-custom-bg .liuren-setup-embed .plate .center,
body.app-custom-bg #liuren-embed-plate .cell,
body.app-custom-bg #liuren-embed-plate .center {
  border: none !important;
  border-width: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}

/* 十二宫四角：圆角贴齐外框，避免角上露粗线 */
html.app-custom-bg .liuren-setup-embed .plate .palace-巳,
html.app-custom-bg #liuren-embed-plate .palace-巳,
body.app-custom-bg .liuren-setup-embed .plate .palace-巳,
body.app-custom-bg #liuren-embed-plate .palace-巳 {
  border-top-left-radius: 11px !important;
}
html.app-custom-bg .liuren-setup-embed .plate .palace-申,
html.app-custom-bg #liuren-embed-plate .palace-申,
body.app-custom-bg .liuren-setup-embed .plate .palace-申,
body.app-custom-bg #liuren-embed-plate .palace-申 {
  border-top-right-radius: 11px !important;
}
html.app-custom-bg .liuren-setup-embed .plate .palace-寅,
html.app-custom-bg #liuren-embed-plate .palace-寅,
body.app-custom-bg .liuren-setup-embed .plate .palace-寅,
body.app-custom-bg #liuren-embed-plate .palace-寅 {
  border-bottom-left-radius: 11px !important;
}
html.app-custom-bg .liuren-setup-embed .plate .palace-亥,
html.app-custom-bg #liuren-embed-plate .palace-亥,
body.app-custom-bg .liuren-setup-embed .plate .palace-亥,
body.app-custom-bg #liuren-embed-plate .palace-亥 {
  border-bottom-right-radius: 11px !important;
}

html.app-custom-bg .liuren-setup-embed .plate .cell:hover,
html.app-custom-bg #liuren-embed-plate .cell:hover,
body.app-custom-bg .liuren-setup-embed .plate .cell:hover {
  box-shadow: none !important;
  transform: none !important;
}


html.app-custom-bg .board-wrap::before,
html.app-custom-bg .qm-board-wrap::before,
html.app-custom-bg .yp-board-wrap::before,
html.app-custom-bg .liuren-setup-embed .board-wrap::before,
html.app-custom-bg .liuren-setup-embed.liuren-has-result .board-wrap::before,
html.app-custom-bg .qimen-setup-embed .qm-board-wrap::before,
html.app-custom-bg .yinpan-setup-embed .yp-board-wrap::before,
html.app-custom-bg .liuyao-setup-embed .board-wrap::before,
html.app-custom-bg #liuyao-result-panel .board-wrap::before,
body.app-custom-bg .board-wrap::before,
body.app-custom-bg.setup-page .board-wrap::before,
body.app-custom-bg.result-page .board-wrap::before {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
}

/* ===== 自定义主题：8px 窄条跟所选主色 ===== */
html.app-custom-bg body .liuren-setup-embed.liuren-has-result .board-wrap::before,
html.app-custom-bg body .liuren-setup-embed .board-wrap::before,
html.app-custom-bg body .qimen-setup-embed .qm-board-wrap::before,
html.app-custom-bg body .yinpan-setup-embed .yp-board-wrap::before,
html.app-custom-bg body .board-wrap::before,
html.app-custom-bg body .qm-board-wrap::before,
html.app-custom-bg body .yp-board-wrap::before,
html.app-custom-bg body .pan-result-gap,
html.app-custom-bg .board-wrap::before,
html.app-custom-bg .qm-board-wrap::before,
html.app-custom-bg .yp-board-wrap::before,
html.app-custom-bg .pan-result-gap,
html.app-custom-bg .liuren-setup-embed .board-wrap::before,
html.app-custom-bg .liuren-setup-embed.liuren-has-result .board-wrap::before,
html.app-custom-bg .qimen-setup-embed .qm-board-wrap::before,
html.app-custom-bg #qimen-result-panel .qm-board-wrap::before,
html.app-custom-bg .yinpan-setup-embed .yp-board-wrap::before,
html.app-custom-bg #yinpan-result-panel .yp-board-wrap::before,
html.app-custom-bg .liuyao-setup-embed .board-wrap::before,
html.app-custom-bg #liuyao-result-panel .board-wrap::before,
html.app-custom-bg .meihua-setup-embed .result-card-divider,
html.app-custom-bg .meihua-setup-embed #meihua-result-inner > .result-card-divider,
html[data-app-bg="custom"] .board-wrap::before,
html[data-app-bg="custom"] .qm-board-wrap::before,
html[data-app-bg="custom"] .yp-board-wrap::before,
html[data-app-bg="custom"] .pan-result-gap,
html[data-app-bg="custom"] .liuren-setup-embed .board-wrap::before,
html[data-app-bg="custom"] .liuren-setup-embed.liuren-has-result .board-wrap::before,
html[data-app-bg="custom"] body .liuren-setup-embed.liuren-has-result .board-wrap::before,
html[data-app-bg="custom"] .qimen-setup-embed .qm-board-wrap::before,
html[data-app-bg="custom"] .yinpan-setup-embed .yp-board-wrap::before,
html[data-app-bg="custom"] .liuyao-setup-embed .board-wrap::before,
html[data-app-bg="custom"] #liuyao-result-panel .board-wrap::before,
body.app-custom-bg .board-wrap::before,
body.app-custom-bg .qm-board-wrap::before,
body.app-custom-bg .yp-board-wrap::before,
body.app-custom-bg .pan-result-gap,
body.app-custom-bg .qimen-setup-embed .qm-board-wrap::before,
body.app-custom-bg .yinpan-setup-embed .yp-board-wrap::before,
body.app-custom-bg .liuren-setup-embed .board-wrap::before,
body.app-custom-bg .liuren-setup-embed.liuren-has-result .board-wrap::before,
body.app-custom-bg .liuyao-setup-embed .board-wrap::before {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
}

/* 刷新防白线：自定义时 split 永不回落白 */
html[data-app-bg="custom"],
html.app-custom-bg {
  --pan-split-bg: var(--app-custom-bg) !important;
}

/* 紫微十二宫：宫间线靠 gap 露底；grid 用分隔灰，宫格/中宫仍用主色 */
html.app-custom-bg body .ziwei-setup-embed .chart-grid,
html.app-custom-bg .ziwei-setup-embed .chart-grid,
body.app-custom-bg .ziwei-setup-embed .chart-grid,
html[data-app-bg="custom"] .ziwei-setup-embed .chart-grid {
  background: #bdbdbd !important;
  background-color: #bdbdbd !important;
  border: 1px solid #bdbdbd !important;
  border-color: #bdbdbd !important;
}
html.app-custom-bg body .ziwei-setup-embed .palace-card,
html.app-custom-bg body .ziwei-setup-embed .center-card,
html.app-custom-bg .ziwei-setup-embed .palace-card,
html.app-custom-bg .ziwei-setup-embed .center-card,
body.app-custom-bg .ziwei-setup-embed .palace-card,
body.app-custom-bg .ziwei-setup-embed .center-card {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
}

/* 八字：通杀 color 后恢复天干地支/藏干五行色（对齐灰色主题） */
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-wood,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-wood,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .cg b.c-wood,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col .c-wood,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-wood,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-wood,
body.app-custom-bg .wz-pan-ui .c-wood {
  color: #2e7d32 !important;
  -webkit-text-fill-color: #2e7d32 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-fire,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-fire,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .cg b.c-fire,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col .c-fire,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-fire,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-fire,
body.app-custom-bg .wz-pan-ui .c-fire {
  color: #c62828 !important;
  -webkit-text-fill-color: #c62828 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-earth,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-earth,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .cg b.c-earth,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col .c-earth,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-earth,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-earth,
body.app-custom-bg .wz-pan-ui .c-earth {
  color: #8d6e3a !important;
  -webkit-text-fill-color: #8d6e3a !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-metal,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-metal,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .cg b.c-metal,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col .c-metal,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-metal,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-metal,
body.app-custom-bg .wz-pan-ui .c-metal {
  color: #9a7b12 !important;
  -webkit-text-fill-color: #9a7b12 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-water,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-water,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .cg b.c-water,
html.app-custom-bg .bazi-setup-embed .wz-pan-ui .scroll-col .c-water,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui .c-water,
body.app-custom-bg .bazi-setup-embed .wz-pan-ui table.bazi td.c-water,
body.app-custom-bg .wz-pan-ui .c-water {
  color: #1565c0 !important;
  -webkit-text-fill-color: #1565c0 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .woodColor,
html.app-custom-bg .bazi-setup-embed .tab-gz-value.woodColor,
html.app-custom-bg .bazi-setup-embed .row-item-gz.woodColor,
body.app-custom-bg .bazi-setup-embed .woodColor,
body.app-custom-bg .bazi-setup-embed .tab-gz-value.woodColor,
body.app-custom-bg .bazi-setup-embed .row-item-gz.woodColor {
  color: #2e7d32 !important;
  -webkit-text-fill-color: #2e7d32 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .fireColor,
html.app-custom-bg .bazi-setup-embed .tab-gz-value.fireColor,
html.app-custom-bg .bazi-setup-embed .row-item-gz.fireColor,
body.app-custom-bg .bazi-setup-embed .fireColor,
body.app-custom-bg .bazi-setup-embed .tab-gz-value.fireColor,
body.app-custom-bg .bazi-setup-embed .row-item-gz.fireColor {
  color: #c62828 !important;
  -webkit-text-fill-color: #c62828 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .soilColor,
html.app-custom-bg .bazi-setup-embed .tab-gz-value.soilColor,
html.app-custom-bg .bazi-setup-embed .row-item-gz.soilColor,
body.app-custom-bg .bazi-setup-embed .soilColor,
body.app-custom-bg .bazi-setup-embed .tab-gz-value.soilColor,
body.app-custom-bg .bazi-setup-embed .row-item-gz.soilColor {
  color: #8d6e3a !important;
  -webkit-text-fill-color: #8d6e3a !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .goldColor,
html.app-custom-bg .bazi-setup-embed .tab-gz-value.goldColor,
html.app-custom-bg .bazi-setup-embed .row-item-gz.goldColor,
body.app-custom-bg .bazi-setup-embed .goldColor,
body.app-custom-bg .bazi-setup-embed .tab-gz-value.goldColor,
body.app-custom-bg .bazi-setup-embed .row-item-gz.goldColor {
  color: #9a7b12 !important;
  -webkit-text-fill-color: #9a7b12 !important;
  background: transparent !important;
}
html.app-custom-bg .bazi-setup-embed .waterColor,
html.app-custom-bg .bazi-setup-embed .tab-gz-value.waterColor,
html.app-custom-bg .bazi-setup-embed .row-item-gz.waterColor,
body.app-custom-bg .bazi-setup-embed .waterColor,
body.app-custom-bg .bazi-setup-embed .tab-gz-value.waterColor,
body.app-custom-bg .bazi-setup-embed .row-item-gz.waterColor {
  color: #1565c0 !important;
  -webkit-text-fill-color: #1565c0 !important;
  background: transparent !important;
}
/* 四柱天干地支：去掉白底阴影，字色跟自定义前景 */
html.app-custom-bg .bazi-setup-embed .pillars-container .pillar-heaven,
html.app-custom-bg .bazi-setup-embed .pillars-container .pillar-earth,
body.app-custom-bg .bazi-setup-embed .pillars-container .pillar-heaven,
body.app-custom-bg .bazi-setup-embed .pillars-container .pillar-earth {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  text-shadow: none !important;
}

/* 选择框 / 选项按钮 / 结果页导航标题：字色与排盘时间一致（--app-custom-fg） */
html.app-custom-bg body select,
html.app-custom-bg body select option,
html.app-custom-bg body .setup-card select,
html.app-custom-bg body .time-select-row select,
html.app-custom-bg body .ming-row select,
html.app-custom-bg body .qimen-option-select,
html.app-custom-bg body .qimen-ju-select,
html.app-custom-bg body .qimen-location-row select,
html.app-custom-bg body .birth-time-field,
html.app-custom-bg body .time-tab,
html.app-custom-bg body .seg-btn,
html.app-custom-bg body .option-chip,
html.app-custom-bg body .setup-seg button,
html.app-custom-bg body .qimen-option-btn,
html.app-custom-bg body .qimen-time-tab,
html.app-custom-bg body .liuyao-ctrl-tabs button,
html.app-custom-bg body .liuyao-primary-btn,
html.app-custom-bg body button.liuyao-primary-btn,
html.app-custom-bg body #liuyao-control-panel .liuyao-primary-btn,
html.app-custom-bg body .liuyao-setup-embed .btn-primary,
html.app-custom-bg body .liuyao-setup-embed .btn-ghost,
html.app-custom-bg body .liuyao-setup-embed .ctrl-tabs button,
html.app-custom-bg body .meihua-setup-embed .ctrl-tabs button,
html.app-custom-bg body .palace-tab,
html.app-custom-bg body .btp-trigger,
html.app-custom-bg body .btp-trigger-label,
html.app-custom-bg body .btp-trigger-main,
html.app-custom-bg body .btp-trigger-mode,
html.app-custom-bg body .btp-trigger-arrow,
html.app-custom-bg body .shared-time-heading,
html.app-custom-bg body #setupResultTopbar .pan-result-topbar__title,
html.app-custom-bg body #setupResultTopbar .topbar-title,
html.app-custom-bg body .pan-result-topbar .topbar-title,
html.app-custom-bg body .pan-result-topbar__title,
html.app-custom-bg body #resultPageTopbar .topbar-title,
html.app-custom-bg body #setupResultTopbar .result-switch-btn,
html.app-custom-bg body #setupResultTopbar .result-switch-btn.active,
html.app-custom-bg body #setupResultTopbar .tab-btn,
html.app-custom-bg body #setupResultTopbar .tab-btn.active,
body.app-custom-bg select,
body.app-custom-bg select option,
body.app-custom-bg .time-select-row select,
body.app-custom-bg .ming-row select,
body.app-custom-bg .qimen-option-select,
body.app-custom-bg .qimen-ju-select,
body.app-custom-bg .time-tab,
body.app-custom-bg .seg-btn,
body.app-custom-bg .option-chip,
body.app-custom-bg .qimen-option-btn,
body.app-custom-bg .liuyao-primary-btn,
body.app-custom-bg button.liuyao-primary-btn,
body.app-custom-bg #liuyao-control-panel .liuyao-primary-btn,
body.app-custom-bg .liuyao-setup-embed .btn-primary,
body.app-custom-bg .liuyao-setup-embed .btn-ghost,
body.app-custom-bg .liuyao-setup-embed .ctrl-tabs button,
body.app-custom-bg #setupResultTopbar .pan-result-topbar__title,
body.app-custom-bg #setupResultTopbar .topbar-title,
body.app-custom-bg .pan-result-topbar .topbar-title,
body.app-custom-bg .pan-result-topbar__title,
body.app-custom-bg #setupResultTopbar .result-switch-btn,
body.app-custom-bg #setupResultTopbar .result-switch-btn.active {
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}

/* 六爻排盘按钮：对齐奇门 cast/option，避免自定义底色上看不清 */
html.app-custom-bg body .liuyao-primary-btn,
html.app-custom-bg body button.liuyao-primary-btn,
html.app-custom-bg body #liuyao-control-panel .liuyao-primary-btn,
html.app-custom-bg body .liuyao-ctrl-tabs button,
html.app-custom-bg body .liuyao-setup-embed .btn-primary,
html.app-custom-bg body .liuyao-setup-embed .btn-ghost,
html.app-custom-bg body .liuyao-setup-embed .ctrl-tabs button,
body.app-custom-bg .liuyao-primary-btn,
body.app-custom-bg button.liuyao-primary-btn,
body.app-custom-bg #liuyao-control-panel .liuyao-primary-btn,
body.app-custom-bg .liuyao-ctrl-tabs button,
body.app-custom-bg .liuyao-setup-embed .btn-primary,
body.app-custom-bg .liuyao-setup-embed .btn-ghost,
body.app-custom-bg .liuyao-setup-embed .ctrl-tabs button {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border: 1px solid #bdbdbd !important;
  border-color: #bdbdbd !important;
}
html.app-custom-bg body .liuyao-ctrl-tabs button.active,
html.app-custom-bg body .liuyao-setup-embed .ctrl-tabs button.active,
body.app-custom-bg .liuyao-ctrl-tabs button.active,
body.app-custom-bg .liuyao-setup-embed .ctrl-tabs button.active {
  background: var(--app-custom-bg-panel) !important;
  background-color: var(--app-custom-bg-panel) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}

/* 龟壳摇卦弹窗图片区：始终黑底，不跟自定义主题色 */
html.app-custom-bg #liuyao-coinModal .ly-shell-stage,
body.app-custom-bg #liuyao-coinModal .ly-shell-stage,
html.app-custom-bg body #liuyao-coinModal .ly-shell-stage {
  background: #000 !important;
  background-color: #000 !important;
  background-image: none !important;
}

/* 八字/紫微排盘页：按钮底必须跟页面底拉开，选中反色 */
html.app-custom-bg body .bazi-setup-embed .setup-area .gender-option,
html.app-custom-bg body .bazi-setup-embed .setup-area .time-tab,
html.app-custom-bg body .bazi-setup-embed .setup-area .option-item,
html.app-custom-bg body .bazi-setup-embed .gender-option,
html.app-custom-bg body .bazi-setup-embed .time-tab,
html.app-custom-bg body .bazi-setup-embed .option-item,
html.app-custom-bg body .bazi-setup-embed .cast-btn,
html.app-custom-bg body .ziwei-setup-embed .gender-option,
html.app-custom-bg body .ziwei-setup-embed .time-tab,
html.app-custom-bg body .ziwei-setup-embed .option-item,
html.app-custom-bg body .ziwei-setup-embed .cast-btn,
body.app-custom-bg .bazi-setup-embed .setup-area .gender-option,
body.app-custom-bg .bazi-setup-embed .setup-area .time-tab,
body.app-custom-bg .bazi-setup-embed .setup-area .option-item,
body.app-custom-bg .bazi-setup-embed .gender-option,
body.app-custom-bg .bazi-setup-embed .time-tab,
body.app-custom-bg .bazi-setup-embed .option-item,
body.app-custom-bg .bazi-setup-embed .cast-btn,
body.app-custom-bg .ziwei-setup-embed .gender-option,
body.app-custom-bg .ziwei-setup-embed .time-tab,
body.app-custom-bg .ziwei-setup-embed .option-item,
body.app-custom-bg .ziwei-setup-embed .cast-btn {
  background: var(--app-custom-btn-bg) !important;
  background-color: var(--app-custom-btn-bg) !important;
  background-image: none !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border: 1px solid #bdbdbd !important;
  border-color: #bdbdbd !important;
  box-shadow: none !important;
}
html.app-custom-bg body .bazi-setup-embed .setup-area .gender-option.active,
html.app-custom-bg body .bazi-setup-embed .setup-area .time-tab.active,
html.app-custom-bg body .bazi-setup-embed .setup-area .option-item.active,
html.app-custom-bg body .bazi-setup-embed .gender-option.active,
html.app-custom-bg body .bazi-setup-embed .time-tab.active,
html.app-custom-bg body .bazi-setup-embed .option-item.active,
html.app-custom-bg body .ziwei-setup-embed .gender-option.active,
html.app-custom-bg body .ziwei-setup-embed .time-tab.active,
html.app-custom-bg body .ziwei-setup-embed .option-item.active,
body.app-custom-bg .bazi-setup-embed .setup-area .gender-option.active,
body.app-custom-bg .bazi-setup-embed .setup-area .time-tab.active,
body.app-custom-bg .bazi-setup-embed .setup-area .option-item.active,
body.app-custom-bg .bazi-setup-embed .gender-option.active,
body.app-custom-bg .bazi-setup-embed .time-tab.active,
body.app-custom-bg .bazi-setup-embed .option-item.active,
body.app-custom-bg .ziwei-setup-embed .gender-option.active,
body.app-custom-bg .ziwei-setup-embed .time-tab.active,
body.app-custom-bg .ziwei-setup-embed .option-item.active {
  background: var(--app-custom-fg) !important;
  background-color: var(--app-custom-fg) !important;
  background-image: none !important;
  color: var(--app-custom-bg) !important;
  -webkit-text-fill-color: var(--app-custom-bg) !important;
  border-color: var(--app-custom-fg) !important;
  box-shadow: none !important;
}
html.app-custom-bg body .bazi-setup-embed .time-tabs,
html.app-custom-bg body .ziwei-setup-embed .time-tabs,
body.app-custom-bg .bazi-setup-embed .time-tabs,
body.app-custom-bg .ziwei-setup-embed .time-tabs {
  background: var(--app-custom-btn-bg) !important;
  background-color: var(--app-custom-btn-bg) !important;
  border-color: #bdbdbd !important;
  color: var(--app-custom-fg) !important;
}
html.app-custom-bg body .bazi-setup-embed .setup-area input,
html.app-custom-bg body .bazi-setup-embed .setup-area select,
html.app-custom-bg body .ziwei-setup-embed input:not([type="hidden"]),
html.app-custom-bg body .ziwei-setup-embed select,
body.app-custom-bg .bazi-setup-embed .setup-area input,
body.app-custom-bg .bazi-setup-embed .setup-area select,
body.app-custom-bg .ziwei-setup-embed input:not([type="hidden"]),
body.app-custom-bg .ziwei-setup-embed select {
  background: var(--app-custom-btn-bg) !important;
  background-color: var(--app-custom-btn-bg) !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
  border-color: #bdbdbd !important;
}

/* 排盘日期整行：强制跟所选色（压过按钮底色规则） */
html.app-custom-bg body #sharedTimeCard,
html.app-custom-bg body .shared-time-card,
html.app-custom-bg body .shared-time-host,
html.app-custom-bg body .shared-time-visible,
html.app-custom-bg body .shared-time-slot,
html.app-custom-bg body .btp-trigger,
html.app-custom-bg body button.btp-trigger,
html.app-custom-bg body .btp-birth-time-section,
html.app-custom-bg body .setup-head-block .btp-birth-time-section,
html.app-custom-bg body .bazi-setup-embed .btp-birth-time-section,
html.app-custom-bg body .ziwei-setup-embed .btp-birth-time-section,
html.app-custom-bg body .bazi-setup-embed .btp-trigger,
html.app-custom-bg body .ziwei-setup-embed .btp-trigger,
html.app-custom-bg body.setup-page .btp-trigger,
html.app-custom-bg body.setup-page button.btp-trigger,
body.app-custom-bg #sharedTimeCard,
body.app-custom-bg .shared-time-card,
body.app-custom-bg .shared-time-host,
body.app-custom-bg .shared-time-visible,
body.app-custom-bg .shared-time-slot,
body.app-custom-bg .btp-trigger,
body.app-custom-bg button.btp-trigger,
body.app-custom-bg .btp-birth-time-section,
body.app-custom-bg .setup-head-block .btp-birth-time-section,
body.app-custom-bg .bazi-setup-embed .btp-trigger,
body.app-custom-bg .ziwei-setup-embed .btp-trigger {
  background: var(--app-custom-bg) !important;
  background-color: var(--app-custom-bg) !important;
  background-image: none !important;
  box-shadow: none !important;
}
html.app-custom-bg body .btp-trigger-label,
html.app-custom-bg body .btp-trigger-main,
html.app-custom-bg body .btp-trigger-mode,
html.app-custom-bg body .btp-trigger-arrow,
html.app-custom-bg body .btp-trigger-right,
html.app-custom-bg body .shared-time-heading,
body.app-custom-bg .btp-trigger-label,
body.app-custom-bg .btp-trigger-main,
body.app-custom-bg .btp-trigger-mode,
body.app-custom-bg .btp-trigger-arrow,
body.app-custom-bg .btp-trigger-right,
body.app-custom-bg .shared-time-heading {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--app-custom-fg) !important;
  -webkit-text-fill-color: var(--app-custom-fg) !important;
}
