/* ============ 全局主题（极简中性，尽量遵循 amis 官方默认样式） ============ */

:root {
    --eh-primary: #3b82f6;
    --eh-primary-dark: #2563eb;
    --eh-bg: #f5f7fa;
    --eh-text: #1e293b;
    --eh-text-sub: #64748b;
    --eh-border: #e8edf2;
    --eh-radius: 8px;
    --eh-sidebar-menu-font-size: 14px;
    --eh-sidebar-submenu-font-size: 13px;
    --eh-sidebar-submenu-icon-size: 12px;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

/* 页面内容超过视口时必须允许纵向滚动，否则长表格底部和分页器会被截断。 */
body {
    overflow-x: hidden;
    overflow-y: auto;
}

/* 页面重建并恢复折叠状态时禁止侧栏过渡，避免先展开再向左收缩的闪动。 */
html.eh-sidebar-restoring .cxd-Layout-aside,
html.eh-sidebar-restoring .cxd-Layout-asideWrap,
html.eh-sidebar-restoring .cxd-Layout-brandBar,
html.eh-sidebar-restoring .cxd-Layout-headerBar,
html.eh-sidebar-restoring .cxd-Layout-footer {
    transition: none !important;
}

/* 加载态 */
#root { min-height: 100vh; background: var(--eh-bg); }

.eh-loading {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    gap: 14px;
    background: var(--eh-bg);
    font-size: 14px;
}

.eh-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--eh-primary);
    border-radius: 50%;
    animation: eh-spin .8s linear infinite;
}

@keyframes eh-spin { to { transform: rotate(360deg); } }

/* 顶栏用户区撑满 headerBar，用户名固定在内容区最右侧。 */
.cxd-Layout-headerBar > .cxd-Service.eh-header-service {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    margin-left: auto;
}

.eh-header-service .eh-header {
    width: auto;
    padding-right: 16px;
}

.eh-user-dropdown { font-size: 14px; }

.cxd-DropDown-menu .cxd-DropDown-button > a > .cxd-Button-icon {
    display: inline-block;
    width: 14px;
    margin-right: 7px !important;
    text-align: center;
}

/* ============ 顶部已打开页面页签 ============ */

.eh-page-tabs {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    gap: 0;
    width: 0;
    min-width: 0;
    height: var(--Layout-header-height);
    min-height: var(--Layout-header-height);
    padding: 0 8px;
    overflow: hidden;
    background: transparent;
    border-bottom: 0;
    border-left: 1px solid #edf1f5;
    box-sizing: border-box;
}

.eh-page-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    height: var(--Layout-header-height);
    padding: 0 14px;
    color: var(--eh-text-sub);
    font-size: 12px;
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.eh-page-tab + .eh-page-tab::before {
    content: "";
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 0;
    width: 1px;
    background: #edf1f5;
}

.eh-page-tab:hover {
    color: var(--eh-primary);
    background: #f8fafc;
}

.eh-page-tab.is-active {
    color: var(--eh-primary);
    background: #f8fafc;
    box-shadow: none;
}

.eh-page-tab.is-active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 7px;
    left: 12px;
    height: 2px;
    background: var(--eh-primary);
    border-radius: 2px 2px 0 0;
}

.eh-page-tab-icon {
    margin-right: 6px;
    font-size: 12px;
    opacity: .78;
}

.eh-page-tab-label {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eh-page-tab-close {
    width: 16px;
    height: 16px;
    margin: 0 -3px 0 7px;
    padding: 0;
    color: #94a3b8;
    font-size: 14px;
    line-height: 14px;
    background: transparent;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
}

.eh-page-tab-close:hover {
    color: #475569;
    background: #e2e8f0;
}

.eh-page-tabs-more {
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: var(--Layout-header-height);
    margin-left: auto;
    padding: 0;
    color: #64748b;
    background: #f8fafc;
    border: 0;
    border-left: 1px solid #e5eaf0;
    cursor: pointer;
}

.eh-page-tabs-more:hover,
.eh-page-tabs-more.is-open {
    color: var(--eh-primary);
    background: #eef4ff;
}

.eh-page-tabs-more .fa-caret-down {
    margin-left: 4px;
    font-size: 10px;
}

.eh-page-tabs-menu {
    position: fixed;
    z-index: 1300;
    min-width: 180px;
    max-width: 280px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e5eaf0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
}

.eh-page-tabs-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 36px;
    padding: 0;
    color: #475569;
    background: #fff;
    white-space: nowrap;
}

.eh-page-tabs-menu-item:hover {
    color: var(--eh-primary);
    background: #f1f5f9;
}

.eh-page-tabs-menu-item.is-active {
    color: #fff;
    background: var(--eh-primary);
}

.eh-page-tabs-menu-switch {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 36px;
    padding: 8px 8px 8px 14px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.eh-page-tabs-menu-switch > i {
    width: 18px;
    margin-right: 7px;
    text-align: center;
    opacity: .8;
}

.eh-page-tabs-menu-switch > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eh-page-tabs-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-right: 5px;
    padding: 0;
    color: #94a3b8;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.eh-page-tabs-menu-close:hover {
    color: #ef4444;
    background: #fff1f2;
}

.eh-page-tabs-menu-item.is-active .eh-page-tabs-menu-close {
    color: currentColor;
    opacity: .78;
}

.eh-page-tabs-menu-item.is-active .eh-page-tabs-menu-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    opacity: 1;
}

.eh-page-tabs-menu-close > i {
    margin: 0;
    font-size: 12px;
}

/* 页面切换加载层固定覆盖主内容区，动画始终位于可视页面正中。 */
.eh-page-loading {
    position: fixed;
    top: var(--Layout-header-height);
    right: 0;
    bottom: 0;
    left: var(--Layout-aside-width);
    z-index: 1150;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, .78);
    backdrop-filter: blur(1px);
}

.eh-page-loading.is-aside-folded {
    left: var(--Layout-aside--folded-width);
}

.eh-page-loading-content {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--eh-text-sub);
    font-size: 14px;
}

.eh-page-loading-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dbeafe;
    border-top-color: var(--eh-primary);
    border-radius: 50%;
    animation: eh-spin .7s linear infinite;
}

/* 侧栏折叠后移除 AMIS 预留的 17px 空间，让菜单项占满 60px。 */
.cxd-Layout--asideFixed.cxd-Layout--folded .cxd-Layout-brandBar {
    padding-right: 0 !important;
    box-sizing: border-box;
}

.cxd-Layout--folded .cxd-Layout-brand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--Layout-header-height);
    padding: 0 !important;
    box-sizing: border-box;
}

.cxd-Layout--folded .cxd-Layout-brand img {
    display: block;
    margin: 0 auto;
}

.cxd-Layout--folded .cxd-Layout-asideInner {
    padding-right: 0 !important;
}

.cxd-Layout--folded .cxd-AsideNav-item,
.cxd-Layout--folded .cxd-AsideNav-item > a,
.cxd-Layout--folded .cxd-AsideNav-itemIcon {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.cxd-Layout--folded .cxd-AsideNav-item > a,
.cxd-Layout--folded .cxd-AsideNav-itemIcon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center;
}

/* ============ 左侧主菜单手风琴 ============ */

.cxd-AsideNav-label.eh-nav-toggle {
    position: relative;
    margin: 0;
    padding: 12px 30px 8px 14px;
    cursor: pointer;
    user-select: none;
    font-size: var(--eh-sidebar-menu-font-size);
    transition: color .15s ease, background .15s ease;
}

.cxd-AsideNav-label.eh-nav-toggle:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, .04);
}

.eh-nav-group-icon {
    display: inline-block;
    width: 18px;
    margin-right: 8px;
    font-size: 13px;
    text-align: center;
}

.cxd-AsideNav-label.eh-nav-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 7px;
    height: 7px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .18s ease;
}

.cxd-AsideNav-label.eh-nav-toggle-open::after {
    transform: translateY(-35%) rotate(225deg);
}

/* 仪表盘在 amis 中以单子项分组承载，视觉上扁平化为普通一级菜单。 */
.cxd-AsideNav-label.eh-nav-toggle.eh-nav-dashboard {
    padding-right: 14px;
}

.cxd-AsideNav-label.eh-nav-toggle.eh-nav-dashboard::after {
    display: none;
}

.cxd-AsideNav-label.eh-nav-toggle.eh-nav-dashboard.eh-nav-dashboard-active {
    color: #60a5fa;
    background: rgba(255, 255, 255, .08);
}

.cxd-AsideNav-item.eh-nav-dashboard-item {
    display: none !important;
}

.cxd-AsideNav-item.eh-nav-section-item {
    display: none;
}

.cxd-AsideNav-item.eh-nav-section-item.eh-nav-section-open {
    display: block;
}

/* 折叠态只显示主菜单图标，子菜单通过右侧悬浮层展示。 */
.cxd-Layout--folded .cxd-AsideNav-item.eh-nav-section-item {
    display: none !important;
}

.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 !important;
    color: #cbd5e1;
    font-size: 0;
    box-sizing: border-box;
}

.cxd-AsideNav-item > a,
.cxd-AsideNav-item > .cxd-AsideNav-itemLink,
.cxd-AsideNav-itemLink,
.cxd-AsideNav-itemText,
.cxd-AsideNav-item .cxd-AsideNav-itemText,
.eh-nav-flyout-item {
    font-size: var(--eh-sidebar-menu-font-size) !important;
}

/* 二级子菜单与一级菜单形成清晰的字号层级。 */
.cxd-AsideNav-item.eh-nav-section-item > a,
.cxd-AsideNav-item.eh-nav-section-item > .cxd-AsideNav-itemLink,
.cxd-AsideNav-item.eh-nav-section-item .cxd-AsideNav-itemText,
.eh-nav-flyout-item {
    font-size: var(--eh-sidebar-submenu-font-size) !important;
}

.cxd-AsideNav-item.eh-nav-section-item .cxd-AsideNav-itemIcon,
.cxd-AsideNav-item.eh-nav-section-item > a > i,
.cxd-AsideNav-item.eh-nav-section-item > .cxd-AsideNav-itemLink > i,
.eh-nav-flyout-item i {
    font-size: var(--eh-sidebar-submenu-icon-size) !important;
}

.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle::after {
    display: none;
}

.cxd-Layout--folded .eh-nav-group-icon {
    display: block;
    width: 100%;
    margin-right: 0;
    color: inherit;
    font-size: 16px;
    line-height: 42px;
    text-align: center;
}

.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle:hover,
.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle.eh-nav-flyout-open,
.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle.eh-nav-group-active,
.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle.eh-nav-dashboard-active {
    color: #60a5fa;
    background: rgba(255, 255, 255, .08);
}

.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle.eh-nav-group-active::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    background: #3b82f6;
    border-radius: 0 2px 2px 0;
}

.cxd-Layout--folded .cxd-AsideNav-label.eh-nav-toggle.eh-nav-dashboard-active::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    background: #3b82f6;
    border-radius: 0 2px 2px 0;
}

.eh-nav-flyout {
    position: fixed;
    z-index: 1400;
    width: 190px;
    padding: 6px 0;
    background: #17212e;
    border-left: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0 4px 4px 0;
    box-shadow: 8px 10px 24px rgba(15, 23, 42, .25);
}

.eh-nav-flyout-title {
    padding: 8px 14px;
    color: #94a3b8;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.eh-nav-flyout-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 8px 14px;
    color: #e2e8f0;
    font-size: var(--eh-sidebar-submenu-font-size) !important;
    text-align: left;
    background: transparent;
    border: 0;
    cursor: pointer;
    box-sizing: border-box;
}

.eh-nav-flyout-item:hover,
.eh-nav-flyout-item.is-active {
    color: #60a5fa;
    background: rgba(255, 255, 255, .08);
}

.eh-nav-flyout-item i {
    width: 20px;
    margin-right: 9px;
    text-align: center;
    font-size: var(--eh-sidebar-submenu-icon-size) !important;
}

/* ============ 页面通用 ============ */

.eh-page { background: transparent; }

.eh-page .cxd-Page-body {
    padding: 16px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .eh-page .cxd-Page-body { padding: 12px; }
    .eh-page-tabs { padding: 0 4px; }
    .eh-page-tab { padding: 0 10px; }
}

/* CRUD 卡片化 */
.eh-page .cxd-Crud,
.eh-page .cxd-Panel {
    border-radius: var(--eh-radius);
    border: 1px solid var(--eh-border);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
    overflow: hidden;
}

/* 操作按钮始终保持单行，列宽不足时由表格横向滚动承载。 */
.eh-page .cxd-OperationField {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
}

.eh-page .cxd-OperationField > .cxd-Button,
.eh-page .cxd-OperationField > .cxd-Button--disabled-wrap {
    flex: 0 0 auto;
}

/* ============ 系统配置中心 ============ */

.eh-config-page .cxd-Page-body {
    padding: 16px;
}

.eh-config-intro {
    padding: 20px 22px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    border: 1px solid var(--eh-border);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(30, 64, 175, .05);
}

.eh-config-intro > .cxd-Container-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.eh-config-heading {
    display: flex;
    align-items: center;
    width: 100%;
}

.eh-config-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-right: 14px;
    color: #fff !important;
    font-size: 18px !important;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    border-radius: 10px;
    box-shadow: 0 5px 12px rgba(37, 99, 235, .22);
}

.eh-config-heading-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
}

.eh-config-heading-copy strong {
    color: var(--eh-text);
    font-size: 17px;
    line-height: 24px;
}

.eh-config-heading-copy small {
    color: var(--eh-text-sub);
    font-size: 13px;
    line-height: 20px;
}

.eh-config-heading-count {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: #64748b !important;
    font-size: 12px !important;
    background: #fff;
    border: 1px solid #dbe7f5;
    border-radius: 16px;
}

.eh-config-heading-count b {
    margin-right: 3px;
    color: var(--eh-primary);
    font-size: 14px;
}

.eh-config-form {
    margin: 12px 0 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--eh-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.eh-config-form .cxd-Form-body {
    padding: 0;
}

.eh-config-tabs .cxd-Tabs-links {
    display: flex !important;
    justify-content: flex-start;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    margin: 0;
    padding: 0 18px;
    background: #fff;
    border-bottom: 1px solid var(--eh-border);
    box-sizing: border-box;
}

.eh-config-tabs .cxd-Tabs-link {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto !important;
    max-width: none !important;
    height: 44px;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #64748b;
    text-align: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    transition: color .15s ease;
}

.eh-config-tabs .cxd-Tabs-link > a:first-child {
    justify-content: center;
    width: auto;
    height: 44px;
    margin: 0 !important;
    padding: 0 24px !important;
    text-align: center;
}

.eh-config-tabs .cxd-Tabs-link:hover {
    color: var(--eh-primary);
    background: transparent;
}

.eh-config-tabs .cxd-Tabs-link.is-active {
    color: var(--eh-primary);
    font-weight: 500;
    background: transparent;
    box-shadow: none;
}

.eh-config-tabs .cxd-Tabs-link.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    display: block;
    height: 2px;
    background: var(--eh-primary);
    border-radius: 2px 2px 0 0;
}

.eh-config-tabs .cxd-Tabs-content {
    padding: 0;
}

.eh-config-table {
    margin: 0;
}

.eh-config-table .cxd-Table-table > thead > tr > th {
    height: 44px;
    padding: 10px 16px;
    color: #475569;
    background: #fff;
}

.eh-config-table .cxd-Table-table > tbody > tr:nth-child(odd) > td {
    background: #f8fafc;
}

.eh-config-table .cxd-Table-table > tbody > tr > td {
    padding: 9px 16px;
    vertical-align: middle;
}

.eh-config-table .cxd-TextControl-input {
    min-height: 34px;
}

.eh-storage-config {
    width: 100%;
}

.eh-storage-config-head,
.eh-storage-config-row {
    display: block;
}

.eh-storage-config-head > .cxd-Container-body,
.eh-storage-config-row > .cxd-Container-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: center;
    width: 100%;
}

.eh-storage-config-head {
    min-height: 44px;
    color: #475569;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.eh-storage-config-head > .cxd-Container-body > *,
.eh-storage-config-label,
.eh-storage-config-control {
    padding: 9px 16px;
}

.eh-storage-config-row {
    min-height: 62px;
    border-bottom: 1px solid #e5e7eb;
}

.eh-storage-config-row:nth-child(even) {
    background: #f8fafc;
}

.eh-storage-config-control .cxd-Form-item {
    width: 100%;
    margin-bottom: 0;
}

.eh-storage-config-control > .cxd-Container-body,
.eh-storage-config-control .cxd-Form-control,
.eh-storage-config-control .cxd-SelectControl,
.eh-storage-config-control .cxd-Select,
.eh-storage-config-control .cxd-TextControl,
.eh-storage-config-control .cxd-TextareaControl {
    width: 100% !important;
    max-width: none !important;
}

@media (max-width: 768px) {
    .eh-storage-config-head > .cxd-Container-body,
    .eh-storage-config-row > .cxd-Container-body {
        grid-template-columns: 1fr;
    }

    .eh-storage-config-head {
        display: none;
    }

    .eh-storage-config-label {
        padding-bottom: 0;
        font-weight: 500;
    }
}

.eh-config-table .cxd-ImageControl {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 56px;
}

.eh-config-table .cxd-ImageControl-item {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 82px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 4px !important;
    position: relative !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.eh-config-table .cxd-ImageControl-addBtn {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row !important;
    gap: 6px;
    width: 104px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

.eh-config-table .cxd-ImageControl-addBtn .ImageControl-addBtn-icon,
.eh-config-table .cxd-ImageControl-addBtn svg {
    flex: 0 0 auto;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
}

.eh-config-table .cxd-ImageControl-addBtn span {
    flex: 0 0 auto;
    line-height: 20px;
    white-space: nowrap;
}

.eh-config-table .cxd-ImageControl-item .cxd-ImageControl-image,
.eh-config-table .cxd-ImageControl-item img {
    position: static !important;
    display: block !important;
    width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    max-height: 46px !important;
    margin: auto !important;
    object-fit: contain;
    transform: none !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image,
.eh-config-table .cxd-ImageControl-item .cxd-Image-thumbWrap,
.eh-config-table .cxd-ImageControl-item .cxd-Image-thumb,
.eh-config-table .cxd-ImageControl-item .cxd-Img-container {
    width: 46px !important;
    min-width: 0 !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 0 !important;
    max-height: 46px !important;
    margin: 0 !important;
    overflow: hidden;
    position: relative !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image,
.eh-config-table .cxd-ImageControl-item .cxd-Image-thumbWrap {
    width: 46px !important;
    max-width: 46px !important;
    overflow: visible !important;
}

.eh-config-table .cxd-ImageControl-itemOverlay {
    display: none !important;
}

/* Small configuration thumbnails must stay readable. AMIS normally covers the
   whole image with preview/action icons on hover, which is unusable at 46px. */
.eh-config-table .cxd-ImageControl-item .cxd-Img-container > .mask,
.eh-config-table .cxd-ImageControl-item .cxd-Img-container .mask,
.eh-config-table .cxd-ImageControl-item .cxd-ImageControl-image .mask,
.eh-config-table .cxd-ImageControl-item .cxd-Image-mask,
.eh-config-table .cxd-ImageControl-item .cxd-Image-info,
.eh-config-table .cxd-ImageControl-item .cxd-ImageControl-itemInfo,
.eh-config-table .cxd-ImageControl-item [class*="Image-mask"],
.eh-config-table .cxd-ImageControl-item [class*="ImageMask"] {
    display: none !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    background: transparent !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.15s ease-in-out;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-thumbWrap {
    overflow: visible !important;
}

.eh-config-table .cxd-ImageControl-item:hover .cxd-Image-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a:first-child {
    display: none !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px !important;
    height: 22px !important;
    margin: 0 !important;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.82);
    color: #fff !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a:last-child {
    color: #dc2626 !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a:last-child svg,
.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a:last-child svg * {
    color: #dc2626 !important;
    fill: #dc2626 !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay > a svg {
    position: relative !important;
    top: -1px !important;
}

.eh-config-table .cxd-ImageControl-item .cxd-Image-overlay svg {
    width: 14px !important;
    height: 14px !important;
}

.eh-config-table .cxd-ImageControl-itemClear {
    z-index: 3;
    top: 2px !important;
    right: 2px !important;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
}

.eh-config-table .cxd-Form-item:has(> .cxd-ImageControl) {
    display: flex;
    align-items: center;
    gap: 12px;
}

.eh-config-table .cxd-ImageControl + .cxd-Form-description,
.eh-config-table .cxd-ImageControl-description {
    flex: 0 1 auto;
    margin: 0;
    line-height: 18px;
}

.eh-config-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 !important;
    padding: 14px 16px;
    border-top: 1px solid var(--eh-border);
}

/* 支付设置使用可增删的横向配置表，宽度不足时只在表格内部滚动。 */
.eh-payment-config {
    padding: 0;
}

.eh-payment-table-shell {
    overflow: hidden;
    border: 1px solid var(--eh-border);
    border-radius: 8px;
    background: #fff;
}

.eh-payment-header,
.eh-payment-header > .cxd-Container-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.eh-payment-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--eh-border);
    background: #fff;
}

.eh-payment-header > .cxd-Container-body {
    width: 100%;
}

.eh-payment-title {
    margin: 0;
    color: var(--eh-text);
    font-size: 16px;
    font-weight: 500;
    line-height: 36px;
    white-space: nowrap;
}

.eh-payment-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0 auto !important;
}

.eh-payment-toolbar .cxd-Button {
    min-width: 132px;
}

.eh-payment-table {
    overflow-x: auto;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
}

/* input-table 自带的独立列工具栏会把标题和主按钮挤成两层，这里统一由列表头部承载。 */
.eh-payment-table .cxd-Table-headToolbar {
    display: none;
}

.eh-payment-table .cxd-Table-table {
    min-width: 900px;
}

.eh-payment-table .cxd-Table-table > thead > tr > th {
    height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
}

.eh-payment-table .cxd-Table-table > tbody > tr > td {
    padding: 8px 12px;
    vertical-align: middle;
}

.eh-payment-table .cxd-TextControl-input,
.eh-payment-table .cxd-Select {
    min-height: 34px;
}

.eh-payment-table .cxd-Table-addBtn {
    margin: 12px;
}

.eh-payment-config-state {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 18px;
}

.eh-payment-config-state.is-ready {
    color: #047857;
    background: #ecfdf5;
}

.eh-payment-config-state.is-empty {
    color: #64748b;
    background: #f1f5f9;
}

.eh-payment-dialog .cxd-Modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.eh-payment-dialog.cxd-Modal-content,
.eh-payment-dialog .cxd-Modal-content {
    max-height: calc(100vh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    overflow: hidden;
}

.eh-payment-dialog .cxd-Form-item--horizontal > .cxd-Form-label {
    width: 96px !important;
    max-width: 96px !important;
    flex: 0 0 96px !important;
}

.eh-payment-dialog .cxd-Form-item--horizontal > .cxd-Form-value {
    min-width: 0;
    flex: 1 1 auto !important;
}

.eh-payment-dialog .cxd-Divider {
    margin: 8px 0 18px;
    color: var(--eh-text-sub);
    font-size: 13px;
    font-weight: 600;
}

/* 长表单弹窗始终限制在视口内，仅滚动内容区，标题和底部操作保持可见。 */
.eh-scroll-dialog.cxd-Modal-content,
.eh-scroll-dialog .cxd-Modal-content {
    display: flex;
    flex-direction: column;
    width: min(1080px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    overflow: hidden;
}

.eh-scroll-dialog.cxd-Modal-content > .cxd-Modal-header,
.eh-scroll-dialog.cxd-Modal-content > .cxd-Modal-footer,
.eh-scroll-dialog .cxd-Modal-header,
.eh-scroll-dialog .cxd-Modal-footer {
    flex: 0 0 auto;
}

.eh-scroll-dialog.cxd-Modal-content > .cxd-Modal-body,
.eh-scroll-dialog .cxd-Modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (max-width: 767px) {
    .eh-scroll-dialog.cxd-Modal-content,
    .eh-scroll-dialog .cxd-Modal-content {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        margin-top: 10px;
        margin-bottom: 10px;
    }
}

/* 表格表头 */
.eh-page .cxd-Table-table > thead > tr > th {
    background: #f8fafc;
    color: var(--eh-text-sub);
    font-weight: 500;
    font-size: 13px;
}

/* 宽表格保留横向滚动，操作列固定在最右侧，避免滚动后找不到操作入口。 */
.eh-page .cxd-Table-table > thead > tr > th.is-sticky-right.is-sticky-first-right,
.eh-page .cxd-Table-table > tbody > tr > td.eh-operation-column.is-sticky-right {
    border-left: 1px solid #e5eaf0;
    box-shadow: -10px 0 14px -14px rgba(15, 23, 42, .45);
}

.eh-page .cxd-Table-table > tbody > tr > td.eh-operation-column {
    background: #fff;
    white-space: nowrap;
}

.eh-page .cxd-Table-table > tbody > tr:hover > td.eh-operation-column {
    background: #f8fbff;
}

.eh-page .eh-operation-column .cxd-Button {
    white-space: nowrap;
}

/* 按钮主色 */
.cxd-Button--primary {
    background: var(--eh-primary);
    border-color: var(--eh-primary);
}

.cxd-Button--primary:not(.is-disabled):hover {
    background: var(--eh-primary-dark);
    border-color: var(--eh-primary-dark);
}

/* 抽屉 */
.cxd-Drawer-header { padding: 18px 24px; border-bottom: 1px solid var(--eh-border); }
.cxd-Drawer-title { font-size: 16px; font-weight: 600; color: var(--eh-text); }

/* 角色权限树在抽屉中保持清晰的可视高度，超出后在树内滚动。 */
.eh-role-menu-tree .cxd-TreeControl > .cxd-Tree,
.cxd-TreeControl.eh-role-menu-tree > .cxd-Tree {
    min-height: 220px;
    max-height: min(36vh, 360px);
    padding: 8px 4px;
    box-sizing: border-box;
}

/* 角色权限较多时仅滚动弹窗主体，标题和底部操作始终留在视口内。 */
.eh-role-dialog.cxd-Modal-content,
.eh-role-dialog .cxd-Modal-content {
    max-height: calc(100vh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    overflow: hidden;
}

.eh-role-dialog.cxd-Modal-content > .cxd-Modal-body,
.eh-role-dialog .cxd-Modal-body {
    min-height: 0;
    overflow-y: auto;
}

/* 操作日志详情：把默认纵向静态字段整理为可快速扫描的审计信息面板。 */
.eh-log-detail-dialog.cxd-Modal-content,
.eh-log-detail-dialog .cxd-Modal-content {
    width: min(780px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
}

.eh-log-detail-dialog.cxd-Modal-content > .cxd-Modal-header,
.eh-log-detail-dialog .cxd-Modal-header {
    padding: 17px 22px;
    border-bottom: 1px solid #e8edf4;
}

.eh-log-detail-dialog .cxd-Modal-title {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.eh-log-detail-dialog.cxd-Modal-content > .cxd-Modal-body,
.eh-log-detail-dialog .cxd-Modal-body {
    min-height: 0;
    padding: 20px 22px;
    overflow-y: auto;
    background: #f8fafc;
}

.eh-log-detail-dialog.cxd-Modal-content > .cxd-Modal-footer,
.eh-log-detail-dialog .cxd-Modal-footer {
    padding: 12px 22px;
    border-top: 1px solid #e8edf4;
    background: #fff;
}

.eh-log-detail-dialog .eh-log-detail-grid {
    margin-right: -6px;
    margin-left: -6px;
}

.eh-log-detail-dialog .eh-log-detail-grid + .eh-log-detail-grid {
    margin-top: 12px;
}

.eh-log-detail-dialog .eh-log-detail-grid > .cxd-Grid-col {
    padding-right: 6px;
    padding-left: 6px;
}

.eh-log-detail-dialog .eh-log-detail-meta.cxd-Form-item {
    min-height: 72px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.eh-log-detail-dialog .cxd-Form-label {
    display: block;
    margin: 0 0 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
}

.eh-log-detail-dialog .eh-log-detail-meta .cxd-Form-static,
.eh-log-detail-dialog .eh-log-detail-meta .cxd-Form-control {
    min-height: 20px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.eh-log-detail-dialog .eh-log-detail-method .cxd-PlainField,
.eh-log-detail-dialog .eh-log-detail-status .cxd-PlainField {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 1px 8px;
    border-radius: 5px;
    background: #eef4ff;
    color: #2563eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
}

.eh-log-detail-dialog .eh-log-detail-field.cxd-Form-item {
    margin: 14px 0 0;
}

.eh-log-detail-dialog .eh-log-detail-field .cxd-Form-static {
    width: 100%;
}

.eh-log-detail-dialog .eh-log-detail-field .cxd-Form-control {
    min-height: 42px;
    padding: 10px 12px;
    overflow: auto;
    border: 1px solid #e3e9f2;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    line-height: 20px;
    box-sizing: border-box;
}

.eh-log-detail-dialog .eh-log-detail-code .cxd-PlainField {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.eh-log-detail-dialog .eh-log-detail-params .cxd-Form-control {
    min-height: 72px;
    max-height: 180px;
}

.eh-log-detail-dialog .eh-log-detail-result .cxd-Form-control {
    min-height: 46px;
}

@media (max-width: 767px) {
    .eh-log-detail-dialog.cxd-Modal-content,
    .eh-log-detail-dialog .cxd-Modal-content {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .eh-log-detail-dialog.cxd-Modal-content > .cxd-Modal-body,
    .eh-log-detail-dialog .cxd-Modal-body {
        padding: 16px;
    }

    .eh-log-detail-dialog .eh-log-detail-grid > .cxd-Grid-col + .cxd-Grid-col {
        margin-top: 10px;
    }
}

/* 角色列表只预览三个菜单权限，其余折叠为 +N，避免权限数量撑高表格。 */
.eh-role-permission-column {
    width: 300px;
    max-width: 300px;
}

.eh-role-permission-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    height: 28px;
    overflow: hidden;
    white-space: nowrap;
    cursor: default;
}

.eh-role-permission-cell > span,
.eh-role-permission-cell > em {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 78px;
    height: 24px;
    padding: 0 9px;
    overflow: hidden;
    color: #475569;
    font-size: 12px;
    font-style: normal;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #e5eaf0;
    border-radius: 5px;
    background: #f8fafc;
    box-sizing: border-box;
}

.eh-role-permission-cell > span:empty,
.eh-role-permission-cell > em:empty {
    display: none;
}

.eh-role-permission-cell > em {
    max-width: none;
    color: var(--eh-primary);
    border-color: #bfdbfe;
    background: #eff6ff;
}

/* 表单间距 */
.cxd-Form-item { margin-bottom: 18px; }

/* 所有居中弹窗表单使用固定标签宽度，避免宽弹窗产生大块左侧空白。 */
.eh-dialog-form .cxd-Form-item--horizontal > .cxd-Form-label {
    width: 88px !important;
    max-width: 88px !important;
    flex: 0 0 88px !important;
    padding-left: 0 !important;
    white-space: nowrap;
}

.eh-dialog-form .cxd-Form-item--horizontal > .cxd-Form-value {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
    flex: 1 1 0 !important;
}

.eh-dialog-form.eh-compact-dialog-form .cxd-Form-item--horizontal > .cxd-Form-label {
    width: 66px !important;
    max-width: 66px !important;
    flex-basis: 66px !important;
}

.eh-dialog-form.eh-compact-dialog-form .cxd-Form-item--horizontal > .cxd-Form-value,
.eh-dialog-form.eh-compact-dialog-form .cxd-Form-item--horizontal > .cxd-Form-value > * {
    max-width: none !important;
}

/* MQTT 配置使用统一横向表单，输入框占满内容区，复制按钮紧贴字段。 */
.eh-mqtt-config-form .cxd-InputGroup {
    width: 100%;
}

.eh-mqtt-config-form .cxd-Form-item--horizontal > .cxd-Form-value > * {
    max-width: none !important;
}

/* 徽标 */
.label { border-radius: 6px; padding: 2px 10px; font-size: 12px; font-weight: normal; }
.label-success { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.label-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.label-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.label-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.label-primary { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

/* ============ 仪表盘 ============ */

.eh-dashboard > .cxd-Page-main,
.eh-dashboard .cxd-Page-body {
    background: var(--eh-bg);
}

.eh-dashboard .cxd-Service {
    width: 100%;
}

.eh-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    margin-bottom: 16px;
}

.eh-dashboard-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 96px;
    padding: 18px 20px;
    border: 1px solid var(--eh-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
    box-sizing: border-box;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.eh-dashboard-stat:hover {
    border-color: #d9e2ec;
    box-shadow: 0 8px 20px rgb(15 23 42 / 7%);
    transform: translateY(-1px);
}

.eh-dashboard-stat-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.eh-dashboard-stat-copy span {
    overflow: hidden;
    color: var(--eh-text-sub);
    font-size: 13px;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eh-dashboard-stat-copy strong {
    margin-top: 7px;
    color: var(--eh-text);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.eh-dashboard-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin-left: 12px;
    border-radius: 10px;
    font-size: 20px;
}

.eh-dashboard-stat--blue .eh-dashboard-stat-icon { color: #2563eb; background: #eff6ff; }
.eh-dashboard-stat--violet .eh-dashboard-stat-icon { color: #7c3aed; background: #f5f3ff; }
.eh-dashboard-stat--cyan .eh-dashboard-stat-icon { color: #0891b2; background: #ecfeff; }
.eh-dashboard-stat--green .eh-dashboard-stat-icon { color: #059669; background: #ecfdf5; }
.eh-dashboard-stat--amber .eh-dashboard-stat-icon { color: #d97706; background: #fffbeb; }
.eh-dashboard-stat--rose .eh-dashboard-stat-icon { color: #e11d48; background: #fff1f2; }
.eh-dashboard-stat--sky .eh-dashboard-stat-icon { color: #0284c7; background: #f0f9ff; }
.eh-dashboard-stat--orange .eh-dashboard-stat-icon { color: #ea580c; background: #fff7ed; }
.eh-dashboard-stat--red .eh-dashboard-stat-icon { color: #dc2626; background: #fef2f2; }
.eh-dashboard-stat--purple .eh-dashboard-stat-icon { color: #9333ea; background: #faf5ff; }

.eh-dashboard .eh-dashboard-panel.cxd-Panel,
.eh-dashboard .eh-dashboard-panel .cxd-Panel {
    overflow: hidden;
    border: 1px solid var(--eh-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 4%);
}

.eh-dashboard .eh-dashboard-panel .cxd-Panel-heading,
.eh-dashboard .eh-dashboard-panel.cxd-Panel > .cxd-Panel-heading {
    min-height: 46px;
    padding: 13px 18px;
    color: var(--eh-text);
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    border-bottom: 1px solid #edf1f5;
    box-sizing: border-box;
}

.eh-dashboard .eh-dashboard-panel .cxd-Panel-body,
.eh-dashboard .eh-dashboard-panel.cxd-Panel > .cxd-Panel-body {
    padding: 16px 18px;
}

.eh-dashboard-trends {
    align-items: stretch;
    margin: 0 -7px 16px;
}

.eh-dashboard-trends > .cxd-Grid-col {
    display: flex;
    padding: 0 7px;
}

.eh-dashboard-trend {
    width: 100%;
    height: 100%;
    margin: 0;
}

.eh-dashboard-trend .cxd-Chart {
    width: 100%;
    min-height: 250px;
    height: clamp(250px, calc(100vh - 640px), 520px) !important;
}

.eh-dashboard-bottom {
    align-items: stretch;
    margin: 0 -7px;
}

.eh-dashboard-bottom > .cxd-Grid-col {
    display: flex;
    padding: 0 7px;
}

.eh-dashboard-bottom > .cxd-Grid-col > .eh-dashboard-panel,
.eh-dashboard-bottom > .cxd-Grid-col > .cxd-Panel {
    width: 100%;
    min-height: 176px;
}

.eh-dashboard-summary,
.eh-dashboard-shortcuts {
    height: 100%;
}

.eh-dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
}

.eh-dashboard-summary-grid > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    min-height: 34px;
    color: var(--eh-text-sub);
    font-size: 13px;
}

.eh-dashboard-summary-grid strong {
    color: var(--eh-text);
    font-size: 18px;
}

.eh-dashboard-shortcuts {
    position: relative;
}

.eh-dashboard-shortcuts .cxd-Panel-body {
    min-height: 98px;
}

.eh-dashboard-shortcut-service,
.eh-dashboard-shortcut-service > .cxd-Service-body {
    width: 100%;
    min-height: 98px;
}

.eh-dashboard-shortcut-service {
    position: relative;
}

.eh-dashboard-shortcut-config {
    position: absolute;
    z-index: 2;
    top: -50px;
    right: 0;
    margin: 0;
    color: var(--eh-text-sub);
}

.eh-dashboard-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, 44px);
    gap: 10px;
    width: 100%;
    min-height: 98px;
}

.eh-dashboard-shortcut-grid .cxd-Each-item {
    min-width: 0;
}

.eh-dashboard-shortcut-grid .cxd-Button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    color: #475569;
    background: #f8fafc;
    border-color: #e5eaf0;
}

.eh-dashboard-shortcut-grid .cxd-Button:hover {
    color: var(--eh-primary);
    background: #eff6ff;
    border-color: #bfdbfe;
}

@media (max-width: 1450px) {
    .eh-dashboard-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .eh-dashboard-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .eh-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .eh-dashboard-stat { min-height: 88px; padding: 15px; }
    .eh-dashboard-bottom > .cxd-Grid-col { width: 100%; margin-bottom: 12px; }
    .eh-dashboard-trends > .cxd-Grid-col { width: 100%; margin-bottom: 12px; }
}

@media (max-width: 480px) {
    .eh-dashboard-stats { grid-template-columns: 1fr; }
    .eh-dashboard-summary-grid { grid-template-columns: 1fr; }
    .eh-dashboard-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, 44px); }
}

/* ============ CRUD 筛选与工具栏 ============ */

.eh-crud-title {
    display: inline-flex;
    align-items: center;
    height: var(--Crud-toolbar-height);
    padding: 0;
    color: var(--eh-text);
    font-size: 16px;
    font-weight: 500;
    line-height: var(--Crud-toolbar-height);
}

/* 筛选表单是工具栏的固定第二行，不再使用 amis 会置顶的 Crud-filter 区域。 */
.eh-page .eh-toolbar-filter { display: none !important; }

.eh-page .eh-toolbar-filter.eh-filter-visible {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.eh-page .cxd-Crud-toolbar-item:has(.eh-toolbar-filter) {
    float: none;
    clear: both;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 12px 0;
    box-sizing: border-box;
}

.eh-page .cxd-Crud-toolbar-item:has(.eh-toolbar-filter:not(.eh-filter-visible)) {
    display: none;
}

/* 展开后保持单行紧凑布局，不再显示重复的“筛选”面板标题。 */
.eh-page .eh-toolbar-filter {
    margin: 0;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius);
}

.eh-page .eh-toolbar-filter .cxd-Form-item { margin-bottom: 0; }

.eh-page .eh-toolbar-filter.cxd-Form--inline > .cxd-Button {
    margin-bottom: 0;
}

.eh-page .eh-toolbar-filter.cxd-Form--inline > .cxd-Button--primary {
    margin-left: auto;
}

.eh-page .cxd-Crud-toolbar { min-height: 36px; }

/* 表格分页：使用紧凑的独立底栏，避免默认 56px 高度造成大块空白。 */
.eh-page .cxd-Crud > .cxd-Crud-body:has(.cxd-Table-footToolbar) {
    margin-bottom: 0;
}

/* 分页条数下拉层挂在 Crud 内部，Crud 默认的 overflow:hidden 会把弹层裁掉。 */
.eh-page .cxd-Crud:has(.eh-crud-footer-toolbar) {
    overflow: visible;
}

.eh-page .eh-crud-footer-toolbar.cxd-Table-footToolbar {
    align-items: center !important;
    min-height: 44px;
    padding: 6px 12px;
    background: #fbfcfe;
    border-top: 1px solid #e8edf4;
    box-sizing: border-box;
}

.eh-page .cxd-Crud .eh-crud-footer-toolbar.cxd-Crud-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px;
    width: 100% !important;
    height: 32px !important;
    min-height: 32px;
    margin: 0 !important;
    padding: 0 !important;
}

.eh-page .cxd-Crud .eh-crud-footer-toolbar.cxd-Crud-toolbar > .cxd-Crud-toolbar-item {
    display: inline-flex !important;
    align-items: center !important;
    height: 32px;
    margin: 0 !important;
    color: #64748b;
    font-size: 12px;
    line-height: 20px;
}

.eh-page .cxd-Crud .eh-crud-footer-toolbar.cxd-Crud-toolbar > .cxd-Crud-toolbar-item:first-child {
    margin-left: auto !important;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-statistics {
    white-space: nowrap;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch > span {
    color: #64748b;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch .cxd-Select {
    width: 68px;
    height: 30px !important;
    min-height: 30px !important;
    border-color: #dbe3ee;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch .cxd-Select:hover {
    border-color: #94a3b8;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch .cxd-Select-valueWrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px !important;
    min-height: 28px;
    padding: 0 !important;
    text-align: center;
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch .cxd-Select-value {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 0;
    text-align: center;
    transform: translateX(-4px);
}

.eh-page .eh-crud-footer-toolbar .cxd-Crud-pageSwitch .cxd-Select-arrow {
    right: 9px;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    margin: 0;
    color: #475569;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li:not(.is-disabled):not(.is-active):hover {
    color: var(--eh-primary);
    border-color: #93b4ff;
    background: #f5f8ff;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li.is-active {
    color: #fff;
    border-color: var(--eh-primary);
    background: var(--eh-primary);
    box-shadow: 0 2px 6px rgba(37, 99, 235, .18);
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li.is-active > a {
    color: inherit;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li.is-disabled {
    color: #cbd5e1;
    border-color: #edf1f6;
    background: #f8fafc;
    cursor: not-allowed;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li > a,
.eh-page .eh-crud-footer-toolbar .cxd-Pagination > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    border: 0 !important;
    border-radius: inherit;
    background: transparent !important;
    box-shadow: none !important;
}

.eh-page .eh-crud-footer-toolbar .cxd-Pagination svg {
    width: 14px;
    height: 14px;
}

/* ============ 字典页 ============ */

.eh-dict-grid .cxd-Grid-col:first-child { padding-right: 8px; }
.eh-dict-grid .cxd-Grid-col:last-child { padding-left: 8px; }

.eh-dict-items .cxd-Crud {
    background: #fff;
    border-radius: var(--eh-radius);
    border: 1px solid var(--eh-border);
}

/* 菜单编辑：图标选择使用纯图标宫格，名称仅通过搜索和悬停提示提供。 */
.cxd-Select-menu:has(.eh-menu-icon-option) {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    padding: 8px !important;
}

.cxd-Select-popover:has(.eh-menu-icon-option) {
    width: 520px !important;
    max-width: calc(100vw - 32px);
}

.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-input {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 36px;
    margin: 0 0 2px;
    padding: 0 10px;
    border: 1px solid #dfe3eb;
    border-radius: 6px;
}

.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-input:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgb(37 99 235 / 10%);
}

.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-option {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 50px;
    padding: 0 !important;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-option:hover,
.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-option.is-highlight {
    border-color: #2563eb;
    background: #eff6ff;
}

.cxd-Select-menu:has(.eh-menu-icon-option) > .cxd-Select-option.is-active {
    border-color: #2563eb;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px #2563eb;
}

.cxd-Select-menu:has(.eh-menu-icon-option) .cxd-Select-option-content,
.cxd-Select-menu:has(.eh-menu-icon-option) .cxd-Select-option-content > span {
    display: block;
    width: 100%;
}

.eh-menu-icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
}

.eh-menu-icon-option > i,
.eh-menu-icon-value > i {
    width: 24px;
    flex: 0 0 24px;
    color: #475569;
    font-size: 20px;
    text-align: center;
}

.eh-menu-icon-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
}

.eh-menu-icon-picker-control .cxd-InputGroup {
    display: flex;
    align-items: stretch;
    position: relative;
    width: 60px;
    height: 60px;
}

.eh-menu-icon-picker-control .cxd-InputGroup-addOn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 2;
    top: 0;
    right: auto;
    bottom: auto;
    left: 0;
    width: 60px !important;
    height: 60px !important;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.eh-menu-icon-picker-control .eh-menu-icon-current {
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    z-index: 2;
    width: 60px;
    height: 60px !important;
    margin: 0;
    color: #475569;
    font-size: 20px;
    border: 0;
    background: transparent;
    pointer-events: none;
    transform: none;
}

.eh-menu-icon-picker-control .cxd-SelectControl {
    flex: 0 0 60px;
    width: 60px;
    min-width: 60px;
}

.eh-menu-icon-picker-control .cxd-Select {
    width: 60px;
    height: 60px;
    min-height: 60px;
    padding: 0;
    border-radius: 6px !important;
    cursor: pointer;
    overflow: visible !important;
}

.eh-menu-icon-picker-control .cxd-Select:hover {
    border-color: #2563eb;
    background: #f8fbff;
}

.eh-menu-icon-picker-control .cxd-Select-arrow {
    display: none !important;
}

.eh-menu-icon-picker-control .cxd-Select-clear {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    z-index: 5;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(15 23 42 / 14%);
}

.eh-menu-icon-picker-control .cxd-Select-clear:hover {
    color: #fff;
    border-color: #ef4444;
    background: #ef4444;
}

.eh-menu-icon-picker-control .cxd-Select-clear > svg {
    width: 10px;
    height: 10px;
}

.eh-menu-icon-picker-control .cxd-Select-value {
    font-size: 0;
}

.eh-menu-icon-picker-control .cxd-Select-placeholder {
    visibility: hidden;
}

.eh-mqtt-live {
    display: grid;
    gap: 16px;
    min-height: 420px;
    padding: 4px;
    color: #334155;
}

.eh-mqtt-live__header,
.eh-mqtt-live__meta,
.eh-mqtt-live__topic {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.eh-mqtt-live__status {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.eh-mqtt-live__status.is-connected {
    color: #047857;
    background: #d1fae5;
}

.eh-mqtt-live__status.is-connecting {
    color: #b45309;
    background: #fef3c7;
}

.eh-mqtt-live__status.is-error,
.eh-mqtt-live__status.is-closed {
    color: #b91c1c;
    background: #fee2e2;
}

.eh-mqtt-live__expiry,
.eh-mqtt-live__meta span {
    color: #64748b;
    font-size: 13px;
}

.eh-mqtt-live__topic {
    justify-content: flex-start;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.eh-mqtt-live__topic code {
    overflow-wrap: anywhere;
    color: #1d4ed8;
}

.eh-mqtt-live__latest,
.eh-mqtt-live__history {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.eh-mqtt-overview,
.eh-history-heading,
.eh-history-pagination,
.eh-device-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.eh-mqtt-overview {
    justify-content: flex-start;
    margin-top: 14px;
}

.eh-vital-alert {
    margin-top: 12px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.eh-vital-alert.is-warning {
    color: #9a3412;
    border-color: #fed7aa;
    background: #fff7ed;
}

.eh-vital-alert.is-critical {
    color: #991b1b;
    border-color: #fecaca;
    background: #fef2f2;
}

.eh-device-state,
.eh-presence-state {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.eh-device-state.is-online,
.eh-presence-state.is-present {
    color: #047857;
    background: #d1fae5;
}

.eh-device-state.is-offline,
.eh-device-state.is-fault {
    color: #b91c1c;
    background: #fee2e2;
}

.eh-device-state.is-unknown,
.eh-presence-state.is-unknown,
.eh-presence-state.is-empty {
    color: #475569;
    background: #e2e8f0;
}

.eh-data-source {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.eh-data-source.is-radar,
.eh-telemetry-table td.is-radar {
    color: #0369a1;
    background: #e0f2fe;
}

.eh-data-source.is-simulated,
.eh-telemetry-table td.is-simulated {
    color: #9a3412;
    background: #ffedd5;
}

.eh-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.eh-metric-card {
    position: relative;
    min-width: 0;
    padding: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.eh-metric-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    content: "";
    background: #64748b;
}

.eh-metric-card.is-heart::before { background: #ef4444; }
.eh-metric-card.is-breath::before { background: #2563eb; }
.eh-metric-card.is-distance::before { background: #f59e0b; }
.eh-metric-card.is-signal::before { background: #10b981; }

.eh-metric-card span,
.eh-metric-card small {
    color: #64748b;
    font-size: 12px;
}

.eh-metric-card strong {
    display: block;
    margin: 6px 0 2px;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}

.eh-metric-card[data-mqtt-role$="-card"] {
    cursor: help;
}

.eh-metric-card .eh-vital-quality {
    display: inline-flex;
    align-items: center;
    margin-top: 9px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.eh-vital-quality.is-valid,
.eh-telemetry-table td.is-valid {
    color: #047857;
}

.eh-vital-quality.is-valid { background: #d1fae5; }

.eh-vital-quality.is-held,
.eh-vital-quality.is-warming,
.eh-vital-quality.is-warning,
.eh-telemetry-table td.is-held,
.eh-telemetry-table td.is-warming,
.eh-telemetry-table td.is-warning {
    color: #b45309;
}

.eh-vital-quality.is-held,
.eh-vital-quality.is-warming,
.eh-vital-quality.is-warning { background: #fef3c7; }

.eh-vital-quality.is-error,
.eh-telemetry-table td.is-error {
    color: #b91c1c;
}

.eh-vital-quality.is-error { background: #fee2e2; }

.eh-vital-quality.is-muted,
.eh-vital-quality.is-unknown,
.eh-vital-quality.is-legacy,
.eh-telemetry-table td.is-muted,
.eh-telemetry-table td.is-unknown,
.eh-telemetry-table td.is-legacy {
    color: #475569;
}

.eh-vital-quality.is-muted,
.eh-vital-quality.is-unknown,
.eh-vital-quality.is-legacy { background: #e2e8f0; }

.eh-device-detail {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
    color: #64748b;
    font-size: 12px;
}

.eh-device-detail span {
    padding: 5px 9px;
    border-radius: 6px;
    background: #f1f5f9;
}

.eh-history-heading {
    margin-bottom: 12px;
}

.eh-history-heading span {
    color: #64748b;
    font-size: 13px;
}

.eh-trend-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.eh-trend-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.eh-trend-card > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #64748b;
    font-size: 12px;
}

.eh-trend-card svg {
    display: block;
    width: 100%;
    height: 90px;
    margin-top: 8px;
}

.eh-trend-range {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 11px;
}

.eh-trend-empty {
    display: grid;
    height: 110px;
    place-items: center;
    color: #94a3b8;
    font-size: 12px;
}

.eh-telemetry-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.eh-telemetry-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 13px;
}

.eh-telemetry-table th,
.eh-telemetry-table td {
    padding: 11px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #f1f5f9;
}

.eh-telemetry-table th {
    color: #475569;
    font-weight: 600;
    background: #f8fafc;
}

.eh-telemetry-table tbody tr:hover { background: #f8fafc; }

.eh-history-pagination {
    justify-content: flex-end;
    margin-top: 14px;
}

.eh-history-pagination button {
    padding: 6px 13px;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.eh-history-pagination button:disabled {
    color: #94a3b8;
    cursor: not-allowed;
    background: #f8fafc;
}

.eh-history-pagination span {
    min-width: 90px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.eh-mqtt-live__history-empty {
    padding: 20px 0;
    color: #94a3b8;
    text-align: center;
}

@media (max-width: 640px) {
    .eh-mqtt-live__header,
    .eh-mqtt-live__meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .eh-metric-grid,
    .eh-trend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
