/* High-contrast, full-surface theme presets. */
.layui-layout-theme-default {
    --theme-primary:#2563eb;--theme-primary-hover:#1d4ed8;--theme-soft:#eaf2ff;
    --theme-canvas:#f2f5f9;--theme-surface:#fff;--theme-surface-muted:#f7f9fc;
    --theme-ink:#14213a;--theme-text:#33445d;--theme-muted:#64748b;--theme-border:#d8e1ec;
    --theme-side:#102a56;--theme-side-2:#0b2148;--theme-side-text:#eaf2ff;--theme-side-muted:#b7cae5;--theme-side-active:#1d4ed8;
    --theme-header:#fff;--theme-tabbar:#edf2f8;
}
.layui-layout-theme-green-1 {
    --ui-primary:#0f766e;--ui-primary-hover:#115e59;--ui-primary-soft:#e5f7f2;
    --theme-primary:#0f766e;--theme-primary-hover:#115e59;--theme-soft:#e5f7f2;
    --theme-canvas:#f0f6f3;--theme-surface:#fff;--theme-surface-muted:#f4faf7;
    --theme-ink:#12352f;--theme-text:#2f504a;--theme-muted:#58736e;--theme-border:#cfdfda;
    --theme-side:#0d4f49;--theme-side-2:#083b37;--theme-side-text:#effffb;--theme-side-muted:#b6dcd4;--theme-side-active:#0b665f;
    --theme-header:#f9fffc;--theme-tabbar:#e6f1ed;
}
.layui-layout-theme-black-1 {
    --ui-primary:#3b82f6;--ui-primary-hover:#60a5fa;--ui-primary-soft:#203858;
    /* Design System V2 的文字/底纹变量必须跟着主题走，否则深色底上仍是深色字（看不清）。 */
    --ui-canvas:#0d1524;--ui-surface:#162134;--ui-surface-muted:#1b2940;
    --ui-ink:#f6f9ff;--ui-text:#d8e4f4;--ui-muted:#aabbd1;
    --ui-border:#34445d;--ui-border-strong:#3f5271;
    --theme-primary:#3b82f6;--theme-primary-hover:#60a5fa;--theme-soft:#203858;
    --theme-canvas:#0d1524;--theme-surface:#162134;--theme-surface-muted:#1b2940;
    --theme-ink:#f6f9ff;--theme-text:#d8e4f4;--theme-muted:#aabbd1;--theme-border:#34445d;
    --theme-side:#080f1d;--theme-side-2:#0b1425;--theme-side-text:#f8fbff;--theme-side-muted:#a9bbd4;--theme-side-active:#1d4ed8;
    --theme-header:#111c2e;--theme-tabbar:#111d30;
    color-scheme:dark;
}
.layui-layout-theme-white-1 {
    --ui-primary:#2563eb;--ui-primary-hover:#1d4ed8;--ui-primary-soft:#eff6ff;
    --theme-primary:#2563eb;--theme-primary-hover:#1d4ed8;--theme-soft:#eff6ff;
    --theme-canvas:#f7f8fa;--theme-surface:#fff;--theme-surface-muted:#f8fafc;
    --theme-ink:#111827;--theme-text:#334155;--theme-muted:#64748b;--theme-border:#e2e8f0;
    --theme-side:#fff;--theme-side-2:#fff;--theme-side-text:#334155;--theme-side-muted:#64748b;--theme-side-active:#eff6ff;
    --theme-header:#fff;--theme-tabbar:#fff;
    color-scheme:light;
}

/* Entire application shell, not only the selected navigation item. */
.layui-layout-body[class*="layui-layout-theme-"] { background:var(--theme-canvas)!important;color:var(--theme-text)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-layout-admin>.layui-header { background:var(--theme-header)!important;border-bottom:1px solid var(--theme-border)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-layout-admin>.layui-side { background:linear-gradient(180deg,var(--theme-side),var(--theme-side-2))!important;border-right-color:var(--theme-border)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-side .layui-logo,
.layui-layout-body[class*="layui-layout-theme-"] .layui-side-scroll,
.layui-layout-body[class*="layui-layout-theme-"] .layui-side-tree { background:transparent!important;border-color:rgba(255,255,255,.12)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-side .layui-logo,
.layui-layout-body[class*="layui-layout-theme-"] .layui-side .layui-logo .headtxt strong,
.layui-layout-body[class*="layui-layout-theme-"] .side-menu-tree a,
.layui-layout-body[class*="layui-layout-theme-"] .side-menu-tree a span,
.layui-layout-body[class*="layui-layout-theme-"] .side-menu-tree a i { color:var(--theme-side-text)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .side-section-label,
.layui-layout-body[class*="layui-layout-theme-"] .side-section-label small,
.layui-layout-body[class*="layui-layout-theme-"] .layui-side .layui-logo .headtxt small { color:var(--theme-side-muted)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child { background:rgba(0,0,0,.12)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .side-system-status { color:var(--theme-side-text)!important;border-color:rgba(255,255,255,.14);background:rgba(255,255,255,.07); }
.layui-layout-body[class*="layui-layout-theme-"] .side-system-status strong,
.layui-layout-body[class*="layui-layout-theme-"] .side-system-status small { color:var(--theme-side-text)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .workspace-tabbar { background:var(--theme-tabbar)!important;border-color:var(--theme-border)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .workspace-tabbar-control { color:var(--theme-text)!important;background:var(--theme-surface-muted)!important;border-color:var(--theme-border)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .workspace-page-tab { color:var(--theme-muted)!important;background:var(--theme-surface-muted)!important;border-color:var(--theme-border)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .workspace-page-tab.is-active { color:var(--theme-primary)!important;background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .workspace-page-tab.is-active:after { background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .think-page-body { background:var(--theme-canvas)!important; }

/* Shared content surfaces. */
.layui-layout-body[class*="layui-layout-theme-"] .layui-card,
.layui-layout-body[class*="layui-layout-theme-"] .layui-layer-content,
.layui-layout-body[class*="layui-layout-theme-"] .ui-page-card,
.layui-layout-body[class*="layui-layout-theme-"] .entity-panel,
.layui-layout-body[class*="layui-layout-theme-"] .balance-book { color:var(--theme-text)!important;border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-card-header,
.layui-layout-body[class*="layui-layout-theme-"] .layui-tab-title,
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-header,
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-header th { color:var(--theme-ink)!important;border-color:var(--theme-border)!important;background:var(--theme-surface-muted)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-table,
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view,
.layui-layout-body[class*="layui-layout-theme-"] .layui-table td,
.layui-layout-body[class*="layui-layout-theme-"] .layui-table th { color:var(--theme-text)!important;border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-table tbody tr:nth-child(even) td { background:var(--theme-surface-muted)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-table tbody tr:hover td { background:var(--theme-soft)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-input,
.layui-layout-body[class*="layui-layout-theme-"] .layui-select,
.layui-layout-body[class*="layui-layout-theme-"] .layui-textarea,
.layui-layout-body[class*="layui-layout-theme-"] select,
.layui-layout-body[class*="layui-layout-theme-"] textarea,
.layui-layout-body[class*="layui-layout-theme-"] input { color:var(--theme-ink)!important;border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] input::placeholder,
.layui-layout-body[class*="layui-layout-theme-"] textarea::placeholder { color:var(--theme-muted)!important;opacity:1; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-btn:not(.layui-btn-primary):not(.layui-btn-danger):not(.layui-btn-warm) { color:#fff!important;border-color:var(--theme-primary)!important;background:var(--theme-primary)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-btn-primary { color:var(--theme-text)!important;border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-btn-primary:hover { color:var(--theme-primary)!important;border-color:var(--theme-primary)!important;background:var(--theme-soft)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .layui-tab-title .layui-this,
.layui-layout-body[class*="layui-layout-theme-"] a { color:var(--theme-primary); }
.layui-layout-body[class*="layui-layout-theme-"] .help-block,
.layui-layout-body[class*="layui-layout-theme-"] .help-label,
.layui-layout-body[class*="layui-layout-theme-"] .text-muted,
.layui-layout-body[class*="layui-layout-theme-"] .layui-word-aux { color:var(--theme-muted)!important; }
.layui-layout-body[class*="layui-layout-theme-"] .help-label b { color:var(--theme-ink)!important; }

/* Explicit dark-mode contrast for custom business cards and modal content. */
.layui-layout-theme-black-1 .think-bg-white,
.layui-layout-theme-black-1 .think-bg-gray,
.layui-layout-theme-black-1 .layui-form-select dl,
.layui-layout-theme-black-1 .layui-form-select dl dd,
.layui-layout-theme-black-1 .layui-table-page,
.layui-layout-theme-black-1 .form-search,
.layui-layout-theme-black-1 [class$="-toolbar"],
.layui-layout-theme-black-1 [class$="-panel"],
.layui-layout-theme-black-1 [class$="-card"] { color:var(--theme-text)!important;border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-theme-black-1 h1,.layui-layout-theme-black-1 h2,.layui-layout-theme-black-1 h3,
.layui-layout-theme-black-1 h4,.layui-layout-theme-black-1 strong,.layui-layout-theme-black-1 label { color:var(--theme-ink); }
.layui-layout-theme-black-1 .layui-layer-title { color:var(--theme-ink)!important;border-color:var(--theme-border)!important;background:var(--theme-surface-muted)!important; }
.layui-layout-theme-black-1 .layui-form-select dl dd:hover,
.layui-layout-theme-black-1 .layui-form-select dl dd.layui-this { color:#fff!important;background:var(--theme-primary)!important; }
.layui-layout-theme-black-1 .theme-choice { border-color:var(--theme-border)!important;background:var(--theme-surface)!important; }
.layui-layout-theme-black-1 .theme-choice b { color:var(--theme-ink)!important; }
.layui-layout-theme-black-1 .theme-choice small { color:var(--theme-muted)!important; }

/* Green and dark sidebars need explicit high-specificity rules because the legacy
   light-navigation skin also uses !important declarations. */
.app-shell.layui-layout-theme-green-1 .layui-layout-admin > .layui-side {
    background:linear-gradient(180deg,#075b50 0%,#06483f 58%,#043b35 100%)!important;
    border-right-color:#06483f!important;
    box-shadow:8px 0 28px rgba(4,72,63,.20)!important;
}
.app-shell.layui-layout-theme-green-1 .layui-side .layui-logo,
.app-shell.layui-layout-theme-green-1 .layui-side .layui-side-scroll,
.app-shell.layui-layout-theme-green-1 .layui-side .layui-side-tree {
    background:transparent!important;
}
.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-item > a,
.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child dd > a,
.app-shell.layui-layout-theme-green-1 .side-menu-tree .side-menu-subgroup > a,
.app-shell.layui-layout-theme-green-1 .side-menu-tree a .nav-text,
.app-shell.layui-layout-theme-green-1 .side-menu-tree a .nav-icon,
.app-shell.layui-layout-theme-green-1 .side-menu-tree a .layui-icon {
    color:#f5fffc!important;
    opacity:1!important;
    text-shadow:0 1px 1px rgba(0,0,0,.18);
}
.app-shell.layui-layout-theme-green-1 .side-section-label,
.app-shell.layui-layout-theme-green-1 .side-section-label small,
.app-shell.layui-layout-theme-green-1 .layui-side .layui-logo .headtxt small {
    color:#d1fae5!important;
    opacity:1!important;
}
.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child {
    background:rgba(0,24,20,.24)!important;
}
.app-shell.layui-layout-theme-green-1 .side-menu-tree .nav-dot { background:#b7f7df!important; }
.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-this > a,
.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-item.layui-this > a {
    color:#fff!important;
    background:#0f9f8f!important;
    box-shadow:0 5px 14px rgba(0,25,22,.24);
}

.app-shell.layui-layout-theme-black-1 .layui-layout-admin > .layui-side {
    background:linear-gradient(180deg,#080f1d 0%,#0b1425 58%,#070d18 100%)!important;
    border-right-color:#26364d!important;
    box-shadow:8px 0 28px rgba(0,0,0,.34)!important;
}
.app-shell.layui-layout-theme-black-1 .layui-side .layui-logo,
.app-shell.layui-layout-theme-black-1 .layui-side .layui-side-scroll,
.app-shell.layui-layout-theme-black-1 .layui-side .layui-side-tree {
    background:transparent!important;
}
.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-item > a,
.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child dd > a,
.app-shell.layui-layout-theme-black-1 .side-menu-tree .side-menu-subgroup > a,
.app-shell.layui-layout-theme-black-1 .side-menu-tree a .nav-text,
.app-shell.layui-layout-theme-black-1 .side-menu-tree a .nav-icon,
.app-shell.layui-layout-theme-black-1 .side-menu-tree a .layui-icon {
    color:#f8fbff!important;
    opacity:1!important;
    text-shadow:0 1px 1px #000;
}
.app-shell.layui-layout-theme-black-1 .side-section-label,
.app-shell.layui-layout-theme-black-1 .side-section-label small,
.app-shell.layui-layout-theme-black-1 .layui-side .layui-logo .headtxt small {
    color:#c7d7eb!important;
    opacity:1!important;
}
.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child {
    background:rgba(255,255,255,.055)!important;
}
.app-shell.layui-layout-theme-black-1 .side-menu-tree .nav-dot { background:#b9cbea!important; }
.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-this > a,
.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-item.layui-this > a {
    color:#fff!important;
    background:#2563eb!important;
    box-shadow:0 5px 16px rgba(0,0,0,.35);
}

/* Sidebar state contrast.
   Keep this section last: the legacy light-navigation skin also declares these
   states with !important, which previously produced white text on a pale panel. */
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a {
    color:var(--theme-side-text)!important;
    border-color:transparent!important;
    background:transparent!important;
    opacity:1!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a .layui-icon {
    color:var(--theme-side-text)!important;
    opacity:1!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a:hover {
    color:#fff!important;
    border-color:rgba(255,255,255,.18)!important;
    background:rgba(255,255,255,.11)!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-nav-itemed > a,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-this > a {
    color:#fff!important;
    border-color:rgba(255,255,255,.22)!important;
    background:var(--theme-side-active)!important;
    box-shadow:0 6px 16px rgba(0,0,0,.22)!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-nav-itemed > a .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-nav-itemed > a .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-nav-itemed > a .layui-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-this > a .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-this > a .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-this > a .layui-icon {
    color:#fff!important;
    opacity:1!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd.layui-this > a,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a.layui-this {
    color:#fff!important;
    border-color:rgba(255,255,255,.2)!important;
    background:var(--theme-side-active)!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd.layui-this > a .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd.layui-this > a .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd.layui-this > a .layui-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a.layui-this .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a.layui-this .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a.layui-this .layui-icon {
    color:#fff!important;
    opacity:1!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group > a .layui-nav-more {
    border-top-color:var(--theme-side-text)!important;
}
.app-shell[class*="layui-layout-theme-"] .side-menu-tree > .side-menu-group.layui-nav-itemed > a .layui-nav-more {
    border-color:transparent transparent #fff!important;
}

/* Minimal white keeps the whole shell light while preserving clear navigation
   contrast. These rules intentionally come after the shared dark-sidebar states. */
.app-shell.layui-layout-theme-white-1 .layui-layout-admin > .layui-side {
    background:#fff!important;
    border-right:1px solid #e2e8f0!important;
    box-shadow:4px 0 18px rgba(15,23,42,.055)!important;
}
.app-shell.layui-layout-theme-white-1 .layui-side .layui-logo,
.app-shell.layui-layout-theme-white-1 .layui-side .layui-side-scroll,
.app-shell.layui-layout-theme-white-1 .layui-side .layui-side-tree {
    border-color:#e2e8f0!important;
    background:#fff!important;
}
.app-shell.layui-layout-theme-white-1 .layui-side .layui-logo,
.app-shell.layui-layout-theme-white-1 .layui-side .layui-logo .headtxt strong,
.app-shell.layui-layout-theme-white-1 .side-menu-tree a,
.app-shell.layui-layout-theme-white-1 .side-menu-tree a span,
.app-shell.layui-layout-theme-white-1 .side-menu-tree a i {
    color:#334155!important;
    opacity:1!important;
    text-shadow:none!important;
}
.app-shell.layui-layout-theme-white-1 .side-section-label,
.app-shell.layui-layout-theme-white-1 .side-section-label small,
.app-shell.layui-layout-theme-white-1 .layui-side .layui-logo .headtxt small {
    color:#64748b!important;
    opacity:1!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child {
    border-color:#e2e8f0!important;
    background:#fff!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree .nav-dot { background:#94a3b8!important; }
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a:hover {
    color:#1d4ed8!important;
    border-color:#dbeafe!important;
    background:#f8fafc!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a:hover .nav-text,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a:hover .nav-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a:hover .layui-icon {
    color:#1d4ed8!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-nav-itemed > a,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-this > a {
    color:#1d4ed8!important;
    border-color:#bfdbfe!important;
    background:#eff6ff!important;
    box-shadow:none!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-nav-itemed > a .nav-text,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-nav-itemed > a .nav-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-nav-itemed > a .layui-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-this > a .nav-text,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-this > a .nav-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-this > a .layui-icon {
    color:#1d4ed8!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd > a:hover {
    color:#1d4ed8!important;
    background:#f8fafc!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd.layui-this > a,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd > a.layui-this {
    color:#1d4ed8!important;
    border-color:#bfdbfe!important;
    background:#eff6ff!important;
    box-shadow:inset 3px 0 #2563eb!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd.layui-this > a .nav-text,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd.layui-this > a .nav-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd.layui-this > a .layui-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd > a.layui-this .nav-text,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd > a.layui-this .nav-icon,
.app-shell.layui-layout-theme-white-1 .side-menu-tree .layui-nav-child dd > a.layui-this .layui-icon {
    color:#1d4ed8!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a .layui-nav-more {
    border-top-color:#64748b!important;
}
.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group.layui-nav-itemed > a .layui-nav-more {
    border-color:transparent transparent #1d4ed8!important;
}
.app-shell.layui-layout-theme-white-1 .side-system-status {
    color:#334155!important;
    border-color:#e2e8f0!important;
    background:#f8fafc!important;
}
.app-shell.layui-layout-theme-white-1 .side-system-status strong,
.app-shell.layui-layout-theme-white-1 .side-system-status small { color:#334155!important; }
.layui-layout-theme-white-1 .layui-card,
.layui-layout-theme-white-1 .ui-page-card,
.layui-layout-theme-white-1 .entity-panel,
.layui-layout-theme-white-1 .balance-book {
    box-shadow:0 1px 3px rgba(15,23,42,.055)!important;
}

/* ==================================================================
   可读性兜底层（必须保持在文件最后）
   contrast.css 用 !important 写死了一批「浅色主题专用」的深色文字，
   一旦侧边栏/页面底色被主题改成深色，就会出现「深字压深底」看不清。
   这里统一按主题变量重新指派，权重高于 contrast.css。
   ================================================================== */

/* 1) 侧边栏二级 / 三级子菜单：所有主题统一用主题侧栏文字色。
      contrast.css 的 .app-shell .side-menu-tree .layui-nav-child dd > a
      权重 (0,3,2)，会盖掉默认主题下的浅色文字，这里用 (0,4,2) 压回去。 */
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a span,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a i,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a .nav-text,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .layui-nav-child dd > a .nav-icon,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .side-menu-subgroup > a,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .side-menu-subgroup > a span,
.app-shell[class*="layui-layout-theme-"] .side-menu-tree .side-menu-subgroup > a i {
    color: var(--theme-side-text) !important;
    opacity: 1 !important;
}
/* 子菜单“当前项”的高亮反白由各主题自身规则处理（极简白是浅底蓝字，
   不能在这里统一写死白色，否则浅色主题下会变成白字压浅底）。 */

/* 2) 暗夜黑：把 contrast.css 写死的深色文字改回主题浅色。
      注意 .topbar-search / .topbar-search kbd / .form-search .layui-form-label
      自带写死的浅色底片，必须保留深色文字，不能一并改浅。 */
.layui-layout-theme-black-1 .context-title,
.layui-layout-theme-black-1 .context-eyebrow,
.layui-layout-theme-black-1 .ui-page-title,
.layui-layout-theme-black-1 .ui-page-heading-copy small,
.layui-layout-theme-black-1 .topbar-icon,
.layui-layout-theme-black-1 .help-block,
.layui-layout-theme-black-1 .help-label,
.layui-layout-theme-black-1 .text-muted,
.layui-layout-theme-black-1 .color-desc,
.layui-layout-theme-black-1 .layui-word-aux,
.layui-layout-theme-black-1 .project-tabs-heading span,
.layui-layout-theme-black-1 .project-order-table-title span,
.layui-layout-theme-black-1 .stat-output-table-title span,
.layui-layout-theme-black-1 .stat-output-updated,
.layui-layout-theme-black-1 .layui-laypage a,
.layui-layout-theme-black-1 .layui-laypage span,
.layui-layout-theme-black-1 .layui-dropdown-menu li,
.layui-layout-theme-black-1 .quick-nav-item strong,
.layui-layout-theme-black-1 .quick-nav-item small,
.layui-layout-theme-black-1 .quick-nav-hint span,
.layui-layout-theme-black-1 .quick-nav-empty,
.layui-layout-theme-black-1 .layui-layer-dialog .layui-layer-content,
.layui-layout-theme-black-1 .layui-field-title legend { color: var(--theme-text) !important; }
.layui-layout-theme-black-1 .quick-nav-search input { color: var(--theme-ink) !important; }
/* 划选文字：--ui-ink 在深色主题下已变成浅色，选区底色要跟着加深。 */
.layui-layout-theme-black-1 ::selection { color: #0d1524 !important; background: color-mix(in srgb, var(--ui-primary) 55%, #ffffff) !important; }
/* 带浅色底片的表单标签（layui-form-pane / 搜索栏）保持深色文字。 */
.layui-layout-theme-black-1 .layui-form-label { color: var(--theme-text) !important; }
.layui-layout-theme-black-1 .form-search .layui-form-label,
.layui-layout-theme-black-1 .layui-form-pane .layui-form-label { color: #475569 !important; }

/* ==================================================================
   3) 考勤日状态色（班 / 闲 / 假 / 缺勤）必须有别于普通单元格
   本文件前面的 .layui-table td{background:var(--theme-surface)!important}
   与本行规则权重同为 (0,3,1)，但加载更晚会盖掉状态底色；
   偶数行 td 规则更是 (0,4,3)。因此这里用 tr:nth-child(n) 提权到
   (0,6,2) 重新指派，保证「假」「缺勤」在任何配色方案下都与「班」明显不同。
   （:nth-child(n) 只用于提升权重，匹配所有行；也不用依赖 tbody 存在。）
   ================================================================== */
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-absent {
    color: #b91c1c !important;
    background: #fee2e2 !important;
    font-weight: 700 !important;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .22);
}
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-leave {
    color: #6d28d9 !important;
    background: #ede9fe !important;
    font-weight: 700 !important;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, .18);
}
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-idle {
    color: #075985 !important;
    background: #e0f2fe !important;
    font-weight: 700 !important;
}
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-rest {
    color: #475569 !important;
    background: #f1f5f9 !important;
    font-weight: 600 !important;
}
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-empty {
    background: #eef3f8 !important;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .08);
}
.layui-layout-body[class*="layui-layout-theme-"] .layui-table-view .layui-table tr:nth-child(n) td.ui-cell-empty .layui-table-cell::after {
    content: '\2014';
    display: block;
    color: #94a3b8;
    text-align: center;
    font-weight: 400;
}

/* ==================================================================
   4) 侧栏对比度硬约束（必须保持在文件最后）
   主题切换、旧缓存或基础样式的加载顺序都不应让菜单文字与背景
   变成同色。深色主题固定深色侧栏+浅色字，极简白固定白底+深色字。
   ================================================================== */
body.app-shell.layui-layout-theme-default .layui-layout.layui-layout-admin > .layui-side,
body.app-shell.layui-layout-theme-green-1 .layui-layout.layui-layout-admin > .layui-side,
body.app-shell.layui-layout-theme-black-1 .layui-layout.layui-layout-admin > .layui-side {
    opacity:1!important;
    filter:none!important;
}
body.app-shell.layui-layout-theme-default .layui-layout.layui-layout-admin > .layui-side {
    background:#102a56 linear-gradient(180deg,#102a56 0%,#0b2148 100%)!important;
}
body.app-shell.layui-layout-theme-green-1 .layui-layout.layui-layout-admin > .layui-side {
    background:#075b50 linear-gradient(180deg,#075b50 0%,#06483f 58%,#043b35 100%)!important;
}
body.app-shell.layui-layout-theme-black-1 .layui-layout.layui-layout-admin > .layui-side {
    background:#080f1d linear-gradient(180deg,#080f1d 0%,#0b1425 58%,#070d18 100%)!important;
}
body.app-shell.layui-layout-theme-default .layui-side .layui-logo,
body.app-shell.layui-layout-theme-default .layui-side .layui-side-scroll,
body.app-shell.layui-layout-theme-default .layui-side .layui-side-tree,
body.app-shell.layui-layout-theme-green-1 .layui-side .layui-logo,
body.app-shell.layui-layout-theme-green-1 .layui-side .layui-side-scroll,
body.app-shell.layui-layout-theme-green-1 .layui-side .layui-side-tree,
body.app-shell.layui-layout-theme-black-1 .layui-side .layui-logo,
body.app-shell.layui-layout-theme-black-1 .layui-side .layui-side-scroll,
body.app-shell.layui-layout-theme-black-1 .layui-side .layui-side-tree {
    background:transparent!important;
    opacity:1!important;
    filter:none!important;
}
body.app-shell.layui-layout-theme-default .side-menu-tree > .side-menu-group > a,
body.app-shell.layui-layout-theme-default .side-menu-tree > .side-menu-group > a span,
body.app-shell.layui-layout-theme-default .side-menu-tree > .side-menu-group > a i,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree > .side-menu-group > a,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree > .side-menu-group > a span,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree > .side-menu-group > a i,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree > .side-menu-group > a,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree > .side-menu-group > a span,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree > .side-menu-group > a i {
    color:var(--theme-side-text)!important;
    -webkit-text-fill-color:var(--theme-side-text)!important;
    opacity:1!important;
    text-shadow:none!important;
}
body.app-shell.layui-layout-theme-default .layui-side .layui-logo,
body.app-shell.layui-layout-theme-default .layui-side .layui-logo strong,
body.app-shell.layui-layout-theme-default .side-section-label,
body.app-shell.layui-layout-theme-default .side-section-label small,
body.app-shell.layui-layout-theme-default .side-menu-tree .layui-nav-child dd > a,
body.app-shell.layui-layout-theme-default .side-menu-tree .layui-nav-child dd > a span,
body.app-shell.layui-layout-theme-default .side-menu-tree .layui-nav-child dd > a i,
body.app-shell.layui-layout-theme-green-1 .layui-side .layui-logo,
body.app-shell.layui-layout-theme-green-1 .layui-side .layui-logo strong,
body.app-shell.layui-layout-theme-green-1 .side-section-label,
body.app-shell.layui-layout-theme-green-1 .side-section-label small,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child dd > a,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child dd > a span,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child dd > a i,
body.app-shell.layui-layout-theme-black-1 .layui-side .layui-logo,
body.app-shell.layui-layout-theme-black-1 .layui-side .layui-logo strong,
body.app-shell.layui-layout-theme-black-1 .side-section-label,
body.app-shell.layui-layout-theme-black-1 .side-section-label small,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child dd > a,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child dd > a span,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child dd > a i {
    color:var(--theme-side-text)!important;
    -webkit-text-fill-color:var(--theme-side-text)!important;
    opacity:1!important;
}
body.app-shell.layui-layout-theme-default .side-menu-tree .layui-nav-child,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree .layui-nav-child,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree .layui-nav-child {
    background:rgba(0,0,0,.18)!important;
}
body.app-shell.layui-layout-theme-default .side-menu-tree > .side-menu-group > a .layui-nav-more,
body.app-shell.layui-layout-theme-green-1 .side-menu-tree > .side-menu-group > a .layui-nav-more,
body.app-shell.layui-layout-theme-black-1 .side-menu-tree > .side-menu-group > a .layui-nav-more {
    border-top-color:var(--theme-side-text)!important;
}
body.app-shell.layui-layout-theme-white-1 .layui-layout.layui-layout-admin > .layui-side {
    background:#fff!important;
}
body.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a,
body.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a span,
body.app-shell.layui-layout-theme-white-1 .side-menu-tree > .side-menu-group > a i {
    color:#334155!important;
    opacity:1!important;
    text-shadow:none!important;
}

/* 旧配置或无主题 class 的页面也保持可读，避免白字压浅底。 */
body.app-shell:not([class*="layui-layout-theme-"]) .layui-layout.layui-layout-admin > .layui-side {
    background:#f8fafc!important;
}
body.app-shell:not([class*="layui-layout-theme-"]) .side-menu-tree a,
body.app-shell:not([class*="layui-layout-theme-"]) .side-menu-tree a span,
body.app-shell:not([class*="layui-layout-theme-"]) .side-menu-tree a i {
    color:#334155!important;
    opacity:1!important;
}
