:root {
    --fx-primary: #1677ff;
    --fx-success: #52c41a;
    --fx-warning: #faad14;
    --fx-error: #ff4d4f;
    --fx-bg: #f1f4f8;
    --fx-sider: #ffffff;
    --fx-panel: #ffffff;
    --fx-panel-muted: #f6f8fb;
    --fx-text: #1f1f1f;
    --fx-text-muted: #64748b;
    --fx-border: #dfe5ec;
    --fx-nav-hover: #e6f4ff;
    --fx-nav-icon: #f2f4f7;
    --fx-nav-icon-active: #bae0ff;
    --fx-shadow: 0 12px 32px rgba(15, 23, 42, 0.11);
    --fx-space-1: 4px;
    --fx-space-2: 8px;
    --fx-space-3: 12px;
    --fx-space-4: 16px;
    --fx-radius-sm: 4px;
    --fx-radius-md: 6px;
    --fx-radius-lg: 8px;
    --fx-elevation-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --fx-elevation-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --fx-theme-transition: 0.18s ease;
}

body {
    margin: 0;
    background: var(--fx-bg);
    color: var(--fx-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    transition:
        grid-template-columns 0.18s ease,
        background-color var(--fx-theme-transition),
        color var(--fx-theme-transition);
    background: var(--fx-bg);
    color: var(--fx-text);
}

.app-shell.theme-classic {
    --fx-primary: #1677ff;
    --fx-success: #52c41a;
    --fx-warning: #faad14;
    --fx-error: #ff4d4f;
    --fx-bg: #f1f4f8;
    --fx-sider: #ffffff;
    --fx-panel: #ffffff;
    --fx-panel-muted: #f6f8fb;
    --fx-text: #1f1f1f;
    --fx-text-muted: #64748b;
    --fx-border: #dfe5ec;
    --fx-nav-hover: #e6f4ff;
    --fx-nav-icon: #f2f4f7;
    --fx-nav-icon-active: #bae0ff;
    --fx-shadow: 0 12px 32px rgba(15, 23, 42, 0.11);
}

.app-shell.theme-techblue {
    --fx-primary: #22c7e8;
    --fx-success: #2ef2a2;
    --fx-warning: #ffd166;
    --fx-error: #ff5c7a;
    --fx-bg: #061a33;
    --fx-sider: #071f3a;
    --fx-panel: #0b2a4a;
    --fx-panel-muted: #0f3459;
    --fx-text: #e5eef7;
    --fx-text-muted: #9ab8cf;
    --fx-border: rgba(109, 213, 255, 0.32);
    --fx-nav-hover: rgba(0, 212, 255, 0.18);
    --fx-nav-icon: rgba(255, 255, 255, 0.08);
    --fx-nav-icon-active: rgba(0, 212, 255, 0.32);
    --fx-shadow: 0 18px 46px rgba(0, 9, 22, 0.36);
}

.app-shell.is-collapsed {
    grid-template-columns: 60px minmax(0, 1fr);
}

.app-sider {
    background: var(--fx-sider);
    border-right: 1px solid var(--fx-border);
    padding: var(--fx-space-4) var(--fx-space-3);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
    transition:
        background-color var(--fx-theme-transition),
        border-color var(--fx-theme-transition),
        color var(--fx-theme-transition);
}

.app-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 14px;
    white-space: nowrap;
}

.app-brand-title {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.app-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--fx-primary);
    color: #fff;
    font-size: 15px;
}

.app-nav {
    display: grid;
    align-content: start;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.nav-group {
    display: grid;
    gap: 4px;
}

.nav-group-title {
    padding: 0 10px;
    color: var(--fx-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.app-shell.is-collapsed .app-nav {
    gap: 10px;
}

.app-shell.is-collapsed .app-sider {
    align-items: center;
    padding: 16px 10px;
}

.app-shell.is-collapsed .app-brand {
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.app-shell.is-collapsed .app-brand-mark {
    width: 32px;
    height: 32px;
}

.app-shell.is-collapsed .nav-group {
    margin-top: 7px;
    padding-top: 12px;
    border-top: 1px solid var(--fx-border);
    width: 100%;
    justify-items: center;
}

.app-shell.is-collapsed .nav-group:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.app-shell.is-collapsed .nav-item-shell {
    display: grid;
    justify-items: center;
}

.app-shell.is-collapsed .app-nav a {
    width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 7px;
}

.app-shell.is-collapsed .sider-toggle {
    width: 32px;
    height: 28px;
    padding: 0;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fx-text-muted);
    padding: 7px 10px;
    border-radius: var(--fx-radius-md);
    text-decoration: none;
    min-height: 36px;
    white-space: nowrap;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
    position: relative;
}

.app-nav button {
    font: inherit;
}

.nav-item-shell {
    position: relative;
}

.app-nav a.active {
    background: var(--fx-nav-icon-active);
    color: var(--fx-primary);
    font-weight: 500;
}

.app-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--fx-primary);
    border-radius: 0 3px 3px 0;
}

.app-nav a:hover {
    background: var(--fx-nav-hover);
    color: var(--fx-primary);
    transform: translateX(2px);
}

.app-nav a:active {
    transform: translateX(1px);
}

.nav-children {
    display: grid;
    gap: 2px;
    margin: 0 0 2px 10px;
    padding: 2px 0 2px 14px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-children a,
.nav-more-button {
    min-height: 28px;
    padding: 4px 8px;
    gap: 8px;
    font-size: 13px;
    position: relative;
    border-radius: 4px;
}

.nav-children a:hover {
    transform: translateX(2px);
}

.nav-children a.active {
    background: var(--fx-nav-hover);
    color: var(--fx-primary);
    font-weight: 500;
}

.nav-children a.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    background: var(--fx-primary);
    border-radius: 0 2px 2px 0;
}

.nav-more-button {
    width: 100%;
    display: flex;
    align-items: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fx-text-muted);
    cursor: pointer;
    text-align: left;
}

.nav-more-button:hover {
    background: var(--fx-nav-hover);
    color: var(--fx-primary);
}

.nav-flyout {
    display: none;
    position: absolute;
    top: 0;
    left: calc(100% + 12px);
    width: 190px;
    padding: 10px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel);
    box-shadow: var(--fx-shadow);
    z-index: 80;
}

.nav-item-shell:hover .nav-flyout,
.nav-flyout:hover {
    display: grid;
    gap: 4px;
}

.nav-flyout strong {
    padding: 2px 8px 6px;
    color: var(--fx-text);
    font-size: 13px;
}

.nav-flyout a,
.nav-flyout button {
    min-height: 30px;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--fx-text-muted);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}

.nav-flyout a.active,
.nav-flyout a:hover,
.nav-flyout button:hover {
    background: var(--fx-nav-hover);
    color: var(--fx-primary);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--fx-nav-icon);
    font-size: 14px;
    font-weight: 700;
}

.app-nav a.active .nav-icon,
.app-nav a:hover .nav-icon {
    background: var(--fx-nav-icon-active);
}

.sider-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid color-mix(in srgb, var(--fx-primary) 52%, var(--fx-border));
    border-radius: 999px;
    background: var(--fx-panel);
    color: var(--fx-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.sider-toggle:hover {
    background: var(--fx-nav-hover);
    border-color: var(--fx-primary);
    color: var(--fx-primary);
}

.toggle-icon {
    font-weight: 700;
    font-size: 16px;
}

.app-main {
    padding: 10px 14px 16px;
    min-width: 0;
}

.tab-workspace {
    min-height: 40px;
    margin: 0 0 10px;
    border-bottom: 1px solid var(--fx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.workspace-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.workspace-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    min-width: 0;
    padding-top: 4px;
}

.workspace-tab {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 8px 0 14px;
    border: 1px solid var(--fx-border);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    background: var(--fx-panel-muted);
    color: var(--fx-text-muted);
    gap: 8px;
}

.workspace-tab a {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.workspace-tab.active {
    background: var(--fx-panel);
    color: var(--fx-primary);
    font-weight: 600;
}

.workspace-tab button {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}

.workspace-tab button:hover {
    background: var(--fx-nav-hover);
}

.tab-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 120px;
    padding: 4px 0;
    background: var(--fx-panel);
    border: 1px solid var(--fx-line);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--fx-text);
}

.tab-context-menu button:hover:not(:disabled) {
    background: var(--fx-nav-hover);
    color: var(--fx-primary);
}

.tab-context-menu button:disabled {
    color: var(--fx-text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.workspace-user {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    color: var(--fx-text-muted);
    white-space: nowrap;
    flex: 0 0 auto;
}

.workspace-user a {
    color: var(--fx-primary);
    text-decoration: none;
}

.workspace-user button {
    font: inherit;
}

.workspace-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-user-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    padding: 10px 2px 0;
    border-top: 1px solid var(--fx-border);
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 20px;
}

.footer-uptime {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    white-space: nowrap;
    cursor: default;
}

.footer-uptime i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fx-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-success) 15%, transparent);
}

@media (max-width: 640px) {
    .app-footer {
        gap: 8px;
    }

    .footer-uptime {
        font-size: 0;
    }

    .footer-uptime::after {
        content: "运行中";
        font-size: 12px;
    }
}

.change-password-link {
    border: 0;
    background: transparent;
    color: var(--fx-primary);
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.change-password-link:hover {
    color: var(--fx-text);
}

.logout-icon-form {
    display: inline-block;
    margin: 0;
}

.logout-icon-link {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    color: var(--fx-text-muted);
    background: none;
    cursor: pointer;
    padding: 0;
}

.logout-icon-link:hover {
    color: var(--fx-primary);
    border-color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.theme-toggle-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    cursor: pointer;
    height: 30px;
    padding: 0;
}

.theme-toggle-button:hover {
    color: var(--fx-primary);
    border-color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.page-header h1 {
    margin: 0;
    font-size: 20px;
}

.page-header p {
    margin: 3px 0 0;
    color: var(--fx-text-muted);
}

.page-header > div {
    min-width: 0;
}

.page-header > .ant-space {
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-bar > .ant-space,
.embedded-action-bar > .ant-space,
.list-toolbar-actions > .ant-space {
    flex-wrap: wrap;
}

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

.metric-card {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    padding: 11px 12px;
    min-width: 0;
}

.metric-card > span {
    display: block;
    color: var(--fx-text-muted);
    margin-bottom: 5px;
    font-size: 13px;
}

.metric-card > strong {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
    display: block;
    letter-spacing: -0.5px;
}

.metric-card > small {
    display: block;
    color: var(--fx-text-muted);
    margin-top: 6px;
    font-size: 12px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.embedded-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 0 10px;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel);
}

.list-toolbar-filters,
.list-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.list-toolbar-filters {
    flex: 1 1 auto;
}

.list-toolbar-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.filter-bar .ant-input-group,
.filter-bar .ant-input,
.filter-bar .ant-select,
.list-toolbar .ant-input-group,
.list-toolbar .ant-input,
.list-toolbar .ant-select {
    max-width: 100%;
}

.ant-space {
    column-gap: 8px !important;
    row-gap: 8px !important;
}

.ant-space-horizontal > .ant-space-item + .ant-space-item {
    margin-left: 8px;
}

.import-upload-button {
    position: relative;
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.import-upload-button:hover {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.import-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.form-help {
    margin-top: 6px;
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.drawer-form-stack {
    display: grid;
    gap: 12px;
}

.drawer-form {
    display: grid;
    gap: 16px;
}

.drawer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.drawer-field {
    display: grid;
    gap: 6px;
}

.drawer-field > span {
    color: var(--fx-text-muted);
    font-size: 13px;
}

.permission-checklist {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel-muted);
    cursor: pointer;
}

.permission-item:hover {
    border-color: color-mix(in srgb, var(--fx-primary) 55%, var(--fx-border));
    background: var(--fx-nav-hover);
}

.permission-item-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.permission-item-copy strong {
    color: var(--fx-text);
    font-size: 13px;
    font-weight: 500;
}

.permission-item-copy small {
    overflow: hidden;
    color: var(--fx-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-plaintext {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel-muted);
    padding: 12px;
}

.token-plaintext code {
    display: block;
    width: max-content;
    min-width: 100%;
    color: var(--fx-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: nowrap;
    user-select: all;
}

.batch-create-intro {
    display: flex;
    align-items: baseline;
    gap: var(--fx-space-2, 8px);
    margin-bottom: var(--fx-space-4, 16px);
    color: var(--fx-text-muted);
}

.batch-create-intro strong {
    color: var(--fx-text);
}

.batch-create-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.batch-create-span-2 {
    grid-column: span 2;
}

.batch-create-span-all {
    grid-column: 1 / -1;
}

.batch-template-help {
    margin-top: 10px;
}

.batch-template-help code,
.batch-preview-table code {
    color: var(--fx-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.batch-create-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 12px;
}

.batch-preview-wrap {
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-sm, 6px);
}

.batch-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.batch-preview-table th,
.batch-preview-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--fx-border);
    text-align: left;
    white-space: nowrap;
}

.batch-preview-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--fx-panel-muted);
    color: var(--fx-text-muted);
    font-weight: 600;
}

.batch-preview-table tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 900px) {
    .batch-create-grid {
        grid-template-columns: 1fr;
    }

    .batch-create-span-2,
    .batch-create-span-all {
        grid-column: auto;
    }
}

.fx-native-select {
    width: 100%;
    height: 32px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text);
    padding: 0 8px;
}

.connection-panel {
    display: grid;
    gap: 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
    padding: 12px;
}

.connection-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fx-border);
}

.connection-panel-header > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.connection-panel-header strong {
    color: var(--fx-text);
    font-size: 14px;
    font-weight: 700;
}

.connection-panel-header span {
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.connection-form {
    display: grid;
    gap: 10px;
}

.inline-check {
    display: inline-flex;
    flex: 0 0 auto;
    width: fit-content;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
}

.inline-check input {
    margin: 0;
}

.share-binding-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px 6px;
}

.share-binding-filter .fx-native-select {
    width: 180px;
}

.connection-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.connection-json-editor {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.connection-json-textarea {
    width: 100%;
    min-height: 190px;
    box-sizing: border-box;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--fx-text);
    background: var(--fx-panel);
}

.connection-field {
    display: grid;
    gap: 5px;
    margin: 0;
    min-width: 0;
}

.connection-field > span {
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.connection-field-wide {
    grid-column: 1 / -1;
}

.connection-field-grid .ant-input,
.connection-field-grid .ant-input-number,
.connection-field-grid .ant-select,
.connection-field-grid .ant-select-selector {
    width: 100%;
}

.connection-info {
    border: 1px dashed var(--fx-border);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    line-height: 1.6;
}

.ant-flex {
    gap: 8px;
}

.ant-form-item:last-child .ant-flex {
    gap: 8px !important;
}

.ant-form-item:last-child .ant-btn + .ant-btn {
    margin-left: 8px;
}

.operation-message {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--fx-panel);
}

.operation-message.error {
    color: var(--fx-error);
    border-color: color-mix(in srgb, var(--fx-error) 42%, var(--fx-border));
}

.operation-message.ok {
    color: var(--fx-success);
    border-color: color-mix(in srgb, var(--fx-success) 42%, var(--fx-border));
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -2px 0 8px;
    color: var(--fx-text-muted);
    font-size: 13px;
}

.page-breadcrumb a {
    color: var(--fx-primary);
    text-decoration: none;
}

.page-breadcrumb span::before {
    content: "/";
    margin-right: 6px;
    color: var(--fx-border);
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 96px;
    color: var(--fx-text-muted);
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.page-loading-dot {
    width: 18px;
    height: 18px;
    border: 2px solid var(--fx-border);
    border-top-color: var(--fx-primary);
    border-radius: 999px;
    animation: fx-spin 0.8s linear infinite;
}

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

.empty-action {
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 16px 0;
}

.form-validation-message {
    color: var(--fx-error);
    background: color-mix(in srgb, var(--fx-error) 8%, var(--fx-panel));
    border: 1px solid color-mix(in srgb, var(--fx-error) 36%, var(--fx-border));
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.entity-link {
    color: var(--fx-primary);
    text-decoration: none;
    cursor: pointer;
}

.entity-link:hover {
    text-decoration: underline;
}

.fx-confirm-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.36);
}

.fx-confirm-dialog {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    width: min(420px, 100%);
    border-radius: 8px;
    border: 1px solid var(--fx-border);
    background: var(--fx-panel);
    box-shadow: var(--fx-shadow);
    padding: 20px;
}

.fx-confirm-icon {
    color: var(--fx-primary);
    font-size: 22px;
}

.fx-confirm-icon.danger {
    color: var(--fx-warning);
}

.fx-confirm-body h3 {
    margin: 0 0 8px;
    color: var(--fx-text);
    font-size: 16px;
}

.fx-confirm-body p {
    margin: 0;
    color: var(--fx-text-muted);
    line-height: 1.6;
}

.fx-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.fx-confirm-items {
    margin-top: 12px;
    padding: 10px;
    background: var(--fx-panel-muted);
    border-radius: 6px;
    border: 1px solid var(--fx-border);
    max-height: 200px;
    overflow-y: auto;
}

.fx-confirm-items-header {
    font-size: 12px;
    font-weight: 500;
    color: var(--fx-text-muted);
    margin-bottom: 8px;
}

.fx-confirm-items-list {
    display: grid;
    gap: 4px;
}

.fx-confirm-item {
    font-size: 13px;
    color: var(--fx-text);
    padding: 4px 6px;
    background: var(--fx-panel);
    border-radius: 4px;
    border: 1px solid var(--fx-border);
}

.fx-confirm-items-more {
    font-size: 12px;
    color: var(--fx-text-muted);
    padding: 4px 6px;
    font-style: italic;
}

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

.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-title-row h2 {
    margin: 0;
}

.section-title-row p {
    margin: 4px 0 0;
    color: var(--fx-text-muted);
}

.thing-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.thing-global-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 12px;
    align-items: start;
}

.thing-list-panel,
.thing-side-panel {
    min-width: 0;
}

.thing-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.section-title-row .import-upload-button,
.thing-panel-toolbar .import-upload-button {
    margin-bottom: 0;
}

.thing-side-panel {
    position: sticky;
    top: 12px;
}

.thing-table-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.thing-table-indent {
    width: 8px;
    height: 8px;
    border-left: 1px solid var(--fx-border-strong);
    border-bottom: 1px solid var(--fx-border-strong);
    flex: 0 0 auto;
}

.thing-side-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.thing-side-heading strong,
.thing-side-heading span {
    display: block;
}

.thing-side-heading strong {
    font-size: 16px;
    color: var(--fx-text);
}

.thing-side-heading span {
    margin-top: 4px;
    color: var(--fx-text-muted);
}

.thing-tree-panel {
    position: sticky;
    top: 12px;
}

.thing-tree {
    display: grid;
    gap: 6px;
    max-height: 520px;
    overflow: auto;
}

.thing-tree-node {
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel-muted);
    color: var(--fx-text);
    min-height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    cursor: pointer;
    text-align: left;
}

.thing-tree-node:hover,
.thing-tree-node.active {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.thing-tree-node span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thing-tree-node small {
    color: var(--fx-text-muted);
    white-space: nowrap;
}

.thing-workspace-panel {
    min-width: 0;
}

.thing-workspace-panel > .ant-tabs > .ant-tabs-nav {
    margin-bottom: 12px;
}

.thing-workspace-section {
    display: grid;
    gap: 12px;
}

.thing-workspace-section h2 {
    margin: 0;
}

.thing-focus-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.thing-focus-metrics.compact {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.thing-focus-metrics div {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--fx-panel-muted);
}

.thing-focus-metrics span,
.thing-focus-metrics small {
    display: block;
    color: var(--fx-text-muted);
}

.thing-focus-metrics strong {
    display: block;
    font-size: 24px;
    margin: 6px 0;
}

.thing-focus-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.thing-side-panel .thing-focus-actions {
    flex-wrap: nowrap;
}

.thing-side-panel .thing-focus-actions .ant-btn {
    padding-inline: 10px;
}

.thing-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    text-decoration: none;
}

.thing-focus-subtitle {
    margin: 0 0 10px;
    color: var(--fx-text);
    font-size: 15px;
}

.thing-child-list {
    display: grid;
    gap: 8px;
}

.thing-child-row {
    width: 100%;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--fx-panel-muted);
    color: var(--fx-text);
    cursor: pointer;
    text-align: left;
}

.thing-child-row:hover {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.thing-child-row span,
.thing-child-row small {
    display: block;
}

.thing-child-row small {
    margin-top: 4px;
    color: var(--fx-text-muted);
}

.member-picker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 12px;
    align-items: start;
}

.member-picker-panel,
.member-selected-panel {
    min-width: 0;
}

.member-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.member-picker-summary {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.member-device-groups,
.member-selected-list {
    display: grid;
    gap: 10px;
}

.member-device-group {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--fx-panel-muted);
}

.member-device-header {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--fx-border);
    background: var(--fx-panel);
    cursor: pointer;
}

.member-device-header span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.member-device-header small,
.member-point-row small,
.member-selected-row small {
    color: var(--fx-text-muted);
}

.member-point-list {
    display: grid;
    max-height: 360px;
    overflow: auto;
}

.member-point-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--fx-border);
    cursor: pointer;
}

.member-point-row:last-child {
    border-bottom: 0;
}

.member-point-row:hover,
.member-point-row.selected {
    background: var(--fx-nav-hover);
}

.member-point-row span,
.member-selected-row div {
    min-width: 0;
}

.member-point-row strong,
.member-point-row small,
.member-selected-row strong,
.member-selected-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-selected-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 8px 10px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
    align-items: start;
}

.detail-list {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
}

.detail-list dt {
    color: var(--fx-text-muted);
}

.detail-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.inline-link-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.table-panel {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    min-width: 0;
}

.table-panel > .ant-table-wrapper {
    overflow-x: auto;
}

.ant-table .ant-space {
    white-space: nowrap;
}

.table-panel h2 {
    margin: 0 0 10px;
    font-size: 16px;
}

.trend-chart {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.trend-chart-meta {
    display: flex;
    align-items: baseline;
    gap: 16px;
    color: var(--fx-text-muted);
    flex-wrap: wrap;
}

.trend-chart-meta strong {
    color: var(--fx-primary);
    font-size: 22px;
}

.trend-preview-chart,
.trend-series-chart {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 10px;
    width: 100%;
    min-height: 240px;
    height: clamp(240px, 32vh, 360px);
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 12px 14px 10px 10px;
}

.trend-preview-chart.full {
    min-height: 300px;
    height: clamp(300px, 42vh, 460px);
}

.trend-series-chart {
    min-height: 420px;
    height: clamp(420px, 54vh, 620px);
}

.trend-series-chart.dashboard {
    min-height: 300px;
    height: clamp(300px, 36vh, 460px);
}

.trend-preview-chart.compact {
    min-height: 210px;
    height: clamp(210px, 26vh, 300px);
}

.trend-grid {
    stroke: var(--fx-border);
    stroke-width: 1;
}

.trend-line {
    fill: none;
    stroke: var(--fx-primary);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.trend-series-line {
    fill: none;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.trend-series-line.stat {
    stroke-width: 2.4;
}

.trend-series-line.max,
.trend-series-line.min {
    stroke-dasharray: 5 4;
}

.trend-series-line.point {
    opacity: 0.85;
}

.trend-axis-line {
    stroke: var(--fx-text-muted);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.trend-axis-label {
    fill: var(--fx-text-muted);
    font-size: 10px;
}

.trend-axis-y {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 26px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.trend-axis-y .trend-axis-tick {
    position: absolute;
    right: 0;
    transform: translateY(-50%);
    max-width: 68px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-axis-y .trend-axis-tick:first-of-type {
    transform: translateY(0);
}

.trend-axis-y .trend-axis-tick:last-of-type {
    transform: translateY(-100%);
}

.trend-axis-title {
    position: absolute;
    left: -48px;
    top: 50%;
    width: 120px;
    color: var(--fx-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    transform: translateY(-50%) rotate(-90deg);
    pointer-events: none;
}

.trend-plot {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding-bottom: 26px;
}

.trend-plot svg {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.trend-axis-x {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.trend-axis-x span {
    position: absolute;
    bottom: 0;
    white-space: nowrap;
}

.trend-axis-x .start {
    transform: translateX(0);
}

.trend-axis-x .middle {
    transform: translateX(-50%);
}

.trend-axis-x .end {
    transform: translateX(-100%);
}

.trend-series-legend {
    grid-column: 2;
    display: flex;
    gap: 8px 14px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.trend-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.trend-legend-item i {
    display: inline-block;
    width: 16px;
    height: 3px;
    border-radius: 999px;
}

.trend-legend-item.max i,
.trend-legend-item.min i {
    background-image: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 10px);
}

.trend-legend-item small {
    color: var(--fx-text-muted);
}

.trend-axis {
    display: flex;
    justify-content: space-between;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.trend-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.data-panel-header,
.alarm-panel-header,
.related-trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.data-panel-heading,
.data-panel-header > div:first-child,
.alarm-panel-header > div:first-child,
.related-trend-header > div:first-child {
    min-width: 0;
}

.data-panel-heading h3,
.data-panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.data-panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
}

.data-panel-updated-at {
    color: var(--fx-text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.trend-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.trend-detail-link {
    color: var(--fx-primary);
    white-space: nowrap;
}

.related-trend-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.related-trend-panel > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.related-trend-header {
    align-items: flex-start;
}

.related-trend-header > div:first-child {
    flex: 1 1 280px;
    min-width: 0;
}

.related-trend-header h2 {
    margin: 0;
    font-size: 16px;
}

.related-trend-header p {
    margin: 4px 0 0;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.related-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.related-toolbar-main {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(260px, 1fr) minmax(110px, 130px) auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.related-filter-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.related-filter-field > span {
    color: var(--fx-text-muted);
    font-size: 12px;
    line-height: 1;
}

.related-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 32px;
    white-space: nowrap;
}

.related-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--fx-text-muted);
    font-size: 13px;
    user-select: none;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
}

.related-advanced-toggle:hover {
    color: var(--fx-primary);
    background: var(--fx-panel-muted);
}

.related-advanced-box {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
    padding: 4px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-advanced-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 48px;
    padding: 8px 0;
}

.related-advanced-row + .related-advanced-row {
    border-top: 1px solid var(--fx-border);
}

.advanced-row-label {
    font-size: 12px;
    color: var(--fx-text-muted);
    min-width: 64px;
    font-weight: 500;
}

.related-inline-setting {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--fx-text-muted);
}

.related-inline-setting > span {
    white-space: nowrap;
}

.related-empty-hint {
    padding: 16px;
    border: 1px dashed var(--fx-border);
    border-radius: 8px;
    text-align: center;
    color: var(--fx-text-muted);
    font-size: 13px;
}

.related-trend-chart {
    display: grid;
    grid-template-columns: 102px minmax(0, 1fr) 88px;
    column-gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 300px;
    height: clamp(300px, 38vw, 440px);
    box-sizing: border-box;
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 12px 14px 30px 10px;
}

.related-trend-chart.normalized {
    grid-template-columns: 102px minmax(0, 1fr);
}

.related-chart-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.related-chart-section > .related-trend-chart {
    flex: 0 0 auto;
    width: 100%;
}

.related-axis {
    position: relative;
    min-width: 0;
    color: var(--fx-text-muted);
    font-size: 11px;
}

.related-axis .related-axis-tick {
    position: absolute;
    left: 24px;
    right: 4px;
    transform: translateY(-50%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    direction: rtl;       /* 长数字从右端收缩，避免"35323.08..." */
    text-align: right;
}

.related-axis-right .related-axis-tick {
    left: 4px;
    right: 24px;
    direction: ltr;
    text-align: left;
}

.related-axis-title {
    position: absolute;
    top: 50%;
    left: -46px;
    width: 116px;
    color: var(--fx-text);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    transform: translateY(-50%) rotate(-90deg);
    pointer-events: none;
}

.related-axis-right .related-axis-title {
    left: 18px;
    transform: translateY(-50%) rotate(90deg);
}

.related-plot {
    position: relative;
    min-width: 0;
    min-height: 0;
}

.related-plot svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.trend-series-line.related {
    stroke-width: 2;
    stroke-dasharray: 5 4;
}

.related-primary-range {
    fill: color-mix(in srgb, var(--fx-primary) 16%, transparent);
    stroke: color-mix(in srgb, var(--fx-primary) 42%, transparent);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.related-range-swatch {
    background: color-mix(in srgb, var(--fx-primary) 22%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--fx-primary) 55%, transparent);
}

.related-tooltip {
    max-width: min(420px, 92vw);
}

.related-legend {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    padding: 0 4px;
}

@media (max-width: 1180px) {
    .related-toolbar-main {
        grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.4fr) minmax(110px, 0.5fr);
    }

    .related-toolbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 760px) {
    .related-toolbar-main {
        grid-template-columns: 1fr;
    }

    .related-toolbar-actions {
        grid-column: auto;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .data-panel-header-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .related-trend-chart,
    .related-trend-chart.normalized {
        grid-template-columns: 88px minmax(0, 1fr);
        height: 300px;
        padding-right: 10px;
    }

    .related-axis-right {
        display: none;
    }
}

.related-analysis-panel {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.related-analysis-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.related-analysis-heading h3,
.related-analysis-card h4 {
    margin: 0;
    color: var(--fx-text);
}

.related-analysis-heading h3 {
    font-size: 15px;
}

.related-analysis-heading p {
    margin: 3px 0 0;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.related-analysis-list {
    display: grid;
    gap: 10px;
}

.related-analysis-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel);
    padding: 12px;
}

.related-analysis-card > header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.related-analysis-card h4 {
    font-size: 14px;
}

.related-analysis-card header span {
    display: block;
    margin-top: 3px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.related-analysis-tags {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.related-analysis-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.related-analysis-metrics > div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel-muted);
}

.related-analysis-metrics span,
.related-analysis-metrics small {
    display: block;
    color: var(--fx-text-muted);
    font-size: 11px;
}

.related-analysis-metrics strong {
    display: block;
    margin: 3px 0;
    overflow: hidden;
    color: var(--fx-text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lag-correlation-chart {
    position: relative;
    height: 132px;
    padding: 8px 8px 24px 34px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel-muted);
}

.lag-correlation-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.lag-chart-zero {
    stroke: var(--fx-border-strong);
    stroke-width: 0.6;
    vector-effect: non-scaling-stroke;
}

.lag-chart-zero.vertical {
    stroke-dasharray: 3 3;
}

.lag-chart-line {
    fill: none;
    stroke: var(--fx-primary);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.lag-chart-axis-label {
    position: absolute;
    left: 7px;
    color: var(--fx-text-muted);
    font-size: 10px;
}

.lag-chart-axis-label.top {
    top: 6px;
}

.lag-chart-axis-label.middle {
    top: 50%;
    transform: translateY(-50%);
}

.lag-chart-axis-label.bottom {
    bottom: 24px;
}

.lag-chart-caption {
    position: absolute;
    right: 8px;
    bottom: 5px;
    left: 34px;
    display: flex;
    justify-content: space-between;
    color: var(--fx-text-muted);
    font-size: 10px;
}

.alarm-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.alarm-panel-header h3 {
    margin: 0;
    font-size: 15px;
}

.alarm-panel-header p {
    margin: 3px 0 0;
    color: var(--fx-text-muted);
}

.alarm-message {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-tabs > .ant-tabs-nav {
    margin-bottom: 10px;
}

.detail-tabs .ant-tabs-tabpane,
.thing-detail-tabs .ant-tabs-tabpane {
    min-width: 0;
}

.thing-detail-tabs > .ant-tabs > .ant-tabs-nav {
    margin-bottom: 10px;
}

.thing-detail-page {
    display: grid;
    gap: 12px;
}

.thing-overview-current {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.thing-overview-current > .section-title-row {
    padding: 0 2px;
}

.fx-bars {
    display: grid;
    gap: 10px;
}

.fx-bar-row {
    display: grid;
    grid-template-columns: minmax(92px, 160px) minmax(0, 1fr) minmax(80px, 112px);
    gap: 12px;
    align-items: center;
}

.fx-bar-row span {
    color: var(--fx-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fx-bar-row strong {
    text-align: right;
    font-weight: 600;
}

.fx-bar-track {
    height: 12px;
    border-radius: 6px;
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    overflow: hidden;
}

.fx-bar-track i {
    display: block;
    height: 100%;
    min-width: 2px;
    background: var(--fx-primary);
}

.fx-radar {
    display: grid;
    place-items: center;
}

.fx-radar svg {
    width: min(520px, 100%);
    height: 320px;
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
}

.radar-grid {
    fill: none;
    stroke: var(--fx-border);
    stroke-width: 0.4;
}

.fx-radar text {
    fill: var(--fx-text-muted);
    font-size: 4px;
}

.fx-radar circle {
    fill: var(--fx-primary);
}

.radar-area {
    fill: color-mix(in srgb, var(--fx-primary) 24%, transparent);
    stroke: var(--fx-primary);
    stroke-width: 1;
}

.thing-dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.thing-dashboard-toolbar p,
.group-card-header p {
    margin: 4px 0 0;
    color: var(--fx-text-muted);
}

.component-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.component-switches label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    color: var(--fx-text-muted);
    background: var(--fx-panel);
    cursor: pointer;
    user-select: none;
}

.component-switches label.active {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.drawer-component-switches {
    max-width: 420px;
}

.thing-dashboard-groups {
    display: grid;
    gap: 16px;
}

.thing-dashboard-group {
    display: grid;
    gap: 18px;
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.group-card-side {
    display: grid;
    justify-items: end;
    gap: 8px;
    min-width: 220px;
}

.group-card-tags {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.group-card-actions {
    color: var(--fx-text-muted);
    font-size: 13px;
}

.group-stats-panel {
    display: grid;
    gap: 10px;
}

.group-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.group-stat-card {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
    padding: 10px;
    min-width: 0;
}

.group-stat-card span {
    display: block;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.group-stat-card strong {
    display: block;
    margin-top: 4px;
    color: var(--fx-text);
    font-size: 18px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-stat-card small {
    display: block;
    margin-top: 3px;
    color: var(--fx-text-muted);
}

.group-stats-outliers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--fx-text-muted);
}

.dashboard-widget {
    display: grid;
    gap: 10px;
}

.dashboard-widget h3 {
    margin: 0;
    font-size: 15px;
}

.trend-preview-chart.dashboard {
    width: 100%;
    min-height: 240px;
    height: clamp(240px, 30vh, 340px);
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
}

.thing-picker {
    display: grid;
    gap: 12px;
}

.thing-picker-tree {
    display: grid;
    gap: 6px;
    max-height: calc(100vh - 180px);
    overflow: auto;
}

.thing-picker-node {
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text);
    cursor: pointer;
    text-align: left;
}

.thing-picker-node:hover {
    border-color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.thing-picker-node small {
    color: var(--fx-text-muted);
}

.share-view-switch {
    display: inline-flex;
    border: 1px solid var(--fx-border);
    border-radius: 7px;
    overflow: hidden;
    background: var(--fx-panel);
}

.share-view-switch button {
    height: 32px;
    min-width: 82px;
    border: none;
    border-right: 1px solid var(--fx-border);
    background: transparent;
    color: var(--fx-text-muted);
    cursor: pointer;
}

.share-view-switch button:last-child {
    border-right: none;
}

.share-view-switch button.active {
    background: var(--fx-primary);
    color: #fff;
}

.share-mode-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 14px;
    flex-wrap: wrap;
}

.share-mode-strip span {
    color: var(--fx-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.share-mode-strip button {
    height: 30px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    cursor: pointer;
    padding: 0 12px;
}

.share-mode-strip button.active,
.share-mode-strip button:hover {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.share-section-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.share-section-title h2 {
    margin: 0;
}

.share-section-title p {
    margin: 5px 0 0;
    color: var(--fx-text-muted);
}

.share-config-time {
    margin-top: 4px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.share-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
}

.share-outer-card {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 14px;
    min-width: 0;
}

.share-outer-card header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.share-outer-card h2 {
    margin: 0;
    font-size: 16px;
}

.share-outer-card p,
.share-card-summary,
.share-point-meta,
.share-point-head span {
    color: var(--fx-text-muted);
}

.share-outer-card p {
    margin: 5px 0 0;
}

.share-card-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    margin-bottom: 10px;
}

.share-point-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.share-point-card {
    border: 1px solid var(--fx-border);
    border-left: 3px solid var(--fx-primary);
    border-radius: 8px;
    background: var(--fx-panel-muted);
    padding: 10px;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.share-point-card.warn {
    border-left-color: var(--fx-warning);
}

.share-point-card.missing {
    border-left-color: var(--fx-text-muted);
}

.share-point-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.share-point-head strong,
.share-point-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-point-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--fx-primary);
    overflow-wrap: anywhere;
}

.share-point-meta {
    display: grid;
    gap: 3px;
    font-size: 12px;
}

.share-point-card button {
    justify-self: start;
    height: 28px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-primary);
    cursor: pointer;
    padding: 0 10px;
}

.ultra-config-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 12px;
    align-items: start;
}

.ultra-wave-panel,
.ultra-param-panel {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 14px;
    min-width: 0;
}

.ultra-wave-toolbar,
.ultra-param-header,
.ultra-wave-axis-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.ultra-wave-toolbar {
    margin-bottom: 12px;
}

.ultra-wave-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.ultra-wave-status span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ultra-point-position {
    display: inline-flex;
    min-width: 42px;
    height: 32px;
    align-items: center;
    justify-content: center;
    color: var(--fx-text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ultra-wave-legend {
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 2px solid var(--fx-primary);
}

.ultra-wave-legend.reference {
    border-top: none;
    height: 8px;
    border-radius: 999px;
    background: var(--fx-warning);
}

.ultra-wave-legend.result {
    border-top: none;
    height: 8px;
    border-radius: 999px;
    background: var(--fx-success);
}

.ultra-wave-legend.assist {
    border-top: none;
    height: 8px;
    border-radius: 999px;
    background: var(--fx-success);
}

.ultra-wave-legend.region {
    height: 8px;
    border-top: none;
    background: color-mix(in srgb, var(--fx-success) 22%, transparent);
}

.ultra-wave-toolbar strong,
.ultra-param-header h2 {
    display: block;
    margin: 0;
    font-size: 16px;
}

.ultra-wave-toolbar span,
.ultra-wave-axis-row {
    color: var(--fx-text-muted);
    font-size: 12px;
}

.ultra-wave-axis-row {
    margin-left: 92px;
}

.ultra-wave-history {
    margin-top: 14px;
    border-top: 1px solid var(--fx-border);
    padding-top: 12px;
}

.ultra-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ultra-history-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ultra-history-actions .ant-btn,
.ultra-history-actions .ant-checkbox-wrapper {
    white-space: nowrap;
}

.ultra-history-header strong {
    display: block;
    font-size: 15px;
}

.ultra-history-header > div:first-child > span {
    display: block;
    margin-top: 2px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

@media (max-width: 640px) {
    .permission-checklist {
        grid-template-columns: 1fr;
    }

    .ultra-history-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ultra-history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

.ultra-history-table {
    overflow-x: auto;
}

.ultra-history-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ultra-history-table th,
.ultra-history-table td {
    border-bottom: 1px solid var(--fx-border);
    padding: 7px 8px;
    text-align: left;
    white-space: nowrap;
}

.ultra-history-table th {
    color: var(--fx-text-muted);
    font-weight: 500;
    background: var(--fx-panel-muted);
}

.ultra-history-table tr.selected td {
    background: color-mix(in srgb, var(--fx-primary) 8%, transparent);
}

.ultra-wave-chart {
    --ultra-wave-y-axis-width: 84px;
    display: grid;
    grid-template-columns: var(--ultra-wave-y-axis-width) minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.ultra-wave-y-axis,
.ultra-wave-plot {
    position: relative;
}

.ultra-wave-y-axis {
    height: 420px;
}

.ultra-wave-plot {
    height: 420px;
    overflow: hidden;
    background: var(--fx-panel-muted);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
}

.ultra-wave-y-title,
.ultra-wave-y-label {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.ultra-wave-y-title {
    left: -54px;
    top: 50%;
    width: 130px;
    color: var(--fx-text);
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    transform: translateY(-50%) rotate(-90deg);
}

.ultra-wave-mode-tag,
.ultra-wave-threshold-tag,
.ultra-wave-feature-tag,
.ultra-wave-assist-tag {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: color-mix(in srgb, var(--fx-panel) 88%, transparent);
    color: var(--fx-text);
    font-size: 12px;
    line-height: 22px;
    padding: 0 8px;
    box-shadow: var(--fx-shadow);
}

.ultra-wave-mode-tag {
    top: 10px;
    right: 12px;
}

.ultra-wave-threshold-tag {
    right: 12px;
    border-color: color-mix(in srgb, var(--fx-error) 55%, var(--fx-border));
    color: var(--fx-error);
}

.ultra-wave-feature-tag {
    right: 12px;
    border-color: color-mix(in srgb, var(--fx-success) 55%, var(--fx-border));
    color: var(--fx-success);
}

.ultra-wave-assist-tag {
    color: var(--fx-success);
}

.ultra-wave-y-label {
    left: 22px;
    width: calc(100% - 22px);
    padding: 1px 5px;
    border-radius: 4px;
    text-align: right;
}

.ultra-wave-x-title {
    margin: 4px 0 0 92px;
    color: var(--fx-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.ultra-wave-svg {
    display: block;
    width: 100%;
    height: 420px;
}

.ultra-wave-axis {
    stroke: var(--fx-border);
    stroke-width: 1;
}

.ultra-wave-grid {
    stroke: color-mix(in srgb, var(--fx-border) 72%, transparent);
    stroke-width: 0.8;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-line {
    fill: none;
    stroke: var(--fx-primary);
    stroke-width: 1.4;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-line.reference {
    stroke: var(--fx-warning);
    stroke-width: 1.2;
    stroke-dasharray: 8 6;
    opacity: 0.82;
}

.ultra-wave-threshold {
    stroke: var(--fx-error);
    stroke-width: 1.2;
    stroke-dasharray: 7 5;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-feature {
    stroke: var(--fx-success);
    stroke-width: 1.2;
    stroke-dasharray: 7 5;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-region.signal {
    fill: color-mix(in srgb, var(--fx-success) 14%, transparent);
}

.ultra-wave-assist-point {
    fill: var(--fx-success);
    stroke: var(--fx-panel);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-result-point {
    fill: var(--fx-success);
    stroke: var(--fx-panel);
    stroke-width: 2.4;
    vector-effect: non-scaling-stroke;
}

.ultra-wave-reference-point {
    fill: var(--fx-warning);
    stroke: var(--fx-panel);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.ultra-param-header {
    margin-bottom: 12px;
}

.ultra-param-sections {
    display: grid;
    gap: 10px;
}

.ultra-param-section {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel-muted);
    padding: 10px;
}

.ultra-param-section h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--fx-text);
}

.ultra-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ultra-field-grid label {
    min-width: 0;
}

.ultra-field-grid label > span,
.ultra-reference-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.ultra-field-grid input,
.ultra-native-select {
    width: 100%;
    height: 32px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text);
    padding: 0 8px;
}

.ultra-field-grid input:disabled {
    color: var(--fx-text-muted);
    background: var(--fx-panel-muted);
}

.ultra-field-hint {
    margin-top: 8px;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.ultra-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ultra-reference-grid > div {
    border: 1px solid var(--fx-border);
    border-radius: 7px;
    background: var(--fx-panel);
    padding: 8px;
}

.ultra-reference-grid strong {
    font-size: 13px;
}

.ultra-inline-actions,
.ultra-param-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.ultra-param-footer {
    padding-top: 12px;
    border-top: 1px solid var(--fx-border);
}

.ultra-message {
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--fx-panel);
}

.ultra-message.ok {
    color: var(--fx-success);
}

.ultra-message.error {
    color: var(--fx-error);
}

@media (max-width: 1100px) {
    .thing-layout,
    .thing-global-layout,
    .detail-grid,
    .dashboard-grid,
    .metric-grid,
    .group-stats-grid,
    .member-picker-layout {
        grid-template-columns: 1fr;
    }

    .related-analysis-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ultra-config-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .related-analysis-card > header {
        display: grid;
    }

    .related-analysis-tags {
        justify-content: flex-start;
    }

    .related-analysis-metrics {
        grid-template-columns: 1fr;
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--fx-primary) 12%, transparent), color-mix(in srgb, var(--fx-success) 8%, transparent)),
        var(--fx-bg);
    padding: 24px;
}

.login-panel {
    width: min(420px, 100%);
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--fx-shadow);
}

.login-brand {
    margin-bottom: 18px;
}

.login-panel h1 {
    margin: 0;
    font-size: 24px;
}

.login-panel p {
    margin: 8px 0 18px;
    color: var(--fx-text-muted);
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: var(--fx-text);
}

.login-form input {
    height: 38px;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    padding: 0 10px;
    font: inherit;
    background: var(--fx-panel);
    color: var(--fx-text);
}

.login-form .check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form .check-row input {
    width: 16px;
    height: 16px;
}

.login-form button {
    height: 40px;
    border: none;
    border-radius: 6px;
    background: var(--fx-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.theme-techblue .ant-table,
.theme-techblue .ant-table-container,
.theme-techblue .ant-table-thead > tr > th,
.theme-techblue .ant-table-tbody > tr > td,
.theme-techblue .ant-table-placeholder,
.theme-techblue .ant-pagination,
.theme-techblue .ant-empty-description,
.theme-techblue .ant-drawer-content,
.theme-techblue .ant-drawer-header,
.theme-techblue .ant-modal-content,
.theme-techblue .ant-modal-header,
.theme-techblue .ant-form-item-label > label {
    background: var(--fx-panel);
    color: var(--fx-text);
    border-color: var(--fx-border);
}

.theme-techblue h1,
.theme-techblue h2,
.theme-techblue h3,
.theme-techblue h4,
.theme-techblue h5,
.theme-techblue h6,
.theme-techblue .ant-typography,
.theme-techblue .ant-card-head-title,
.theme-techblue .ant-card-meta-title,
.theme-techblue .ant-descriptions-title,
.theme-techblue .ant-statistic-content,
.theme-techblue .ant-modal-confirm-title,
.theme-techblue .ant-result-title,
.theme-techblue .ant-page-header-heading-title {
    color: var(--fx-text);
}

.theme-techblue .ant-card,
.theme-techblue .ant-card-head,
.theme-techblue .ant-card-body,
.theme-techblue .ant-popover-inner,
.theme-techblue .ant-popover-title,
.theme-techblue .ant-dropdown-menu {
    background: var(--fx-panel);
    color: var(--fx-text);
    border-color: var(--fx-border);
}

.theme-techblue .ant-card-meta-description,
.theme-techblue .ant-descriptions-item-label,
.theme-techblue .ant-descriptions-item-content,
.theme-techblue .ant-statistic-title,
.theme-techblue .ant-form-item-extra,
.theme-techblue .ant-form-item-explain,
.theme-techblue .ant-modal-confirm-content,
.theme-techblue .ant-result-subtitle,
.theme-techblue .ant-popover-inner-content,
.theme-techblue .ant-dropdown-menu-item,
.theme-techblue .ant-radio-wrapper,
.theme-techblue .ant-checkbox-wrapper {
    color: var(--fx-text-muted);
}

.theme-techblue .ant-table-column-title,
.theme-techblue .ant-table-thead .ant-table-column-sorters,
.theme-techblue .ant-table-thead .ant-table-filter-column {
    color: var(--fx-text);
}

.theme-techblue .ant-table-column-sorter,
.theme-techblue .ant-table-filter-trigger,
.theme-techblue .ant-pagination-item-link,
.theme-techblue .ant-select-arrow,
.theme-techblue .ant-picker-suffix {
    color: var(--fx-text-muted);
}

.theme-techblue .ant-tabs-nav,
.theme-techblue .ant-tabs-content-holder {
    color: var(--fx-text);
}

.theme-techblue .ant-tabs-tab .ant-tabs-tab-btn {
    color: var(--fx-text-muted);
}

.theme-techblue .ant-tabs-tab-active .ant-tabs-tab-btn,
.theme-techblue .ant-tabs-tab:hover .ant-tabs-tab-btn {
    color: var(--fx-primary);
}

.theme-techblue .ant-tabs-ink-bar {
    background: var(--fx-primary);
}

.theme-techblue .ant-table-tbody > tr.ant-table-row:hover > td {
    background: var(--fx-panel-muted);
}

.theme-techblue .ant-input,
.theme-techblue .ant-input-number,
.theme-techblue .ant-input-number-input,
.theme-techblue .ant-input-affix-wrapper,
.theme-techblue .ant-select-selector,
.theme-techblue .ant-select-dropdown,
.theme-techblue .ant-picker,
.theme-techblue .ant-picker-input > input,
.theme-techblue textarea.ant-input {
    background: var(--fx-panel-muted) !important;
    color: var(--fx-text) !important;
    border-color: var(--fx-border) !important;
}

.theme-techblue .ant-select-selection-item,
.theme-techblue .ant-select-item {
    color: var(--fx-text);
}

.theme-techblue .ant-select-item-option-active,
.theme-techblue .ant-select-item-option-selected {
    background: var(--fx-nav-hover) !important;
}

.theme-techblue .ant-input::placeholder,
.theme-techblue textarea.ant-input::placeholder,
.theme-techblue .ant-select-selection-placeholder {
    color: var(--fx-text-muted) !important;
}

.theme-techblue .ant-btn:not(.ant-btn-primary):not(.ant-btn-dangerous) {
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    border-color: var(--fx-border);
}

.theme-techblue .ant-btn:not(.ant-btn-primary):not(.ant-btn-dangerous):hover {
    color: var(--fx-primary);
    border-color: var(--fx-primary);
}

.theme-techblue .ant-drawer-close,
.theme-techblue .ant-drawer-title,
.theme-techblue .ant-modal-title {
    color: var(--fx-text);
}

.theme-techblue .ant-alert {
    background: var(--fx-panel-muted);
    color: var(--fx-text);
    border-color: var(--fx-border);
}

.theme-techblue .ant-divider {
    border-color: var(--fx-border);
}

.theme-techblue .ant-tag {
    border-color: var(--fx-border);
}

.ant-drawer-body form > .ant-form-item:last-child {
    position: sticky;
    bottom: -24px;
    z-index: 2;
    margin: 16px -24px -24px;
    padding: 12px 24px;
    border-top: 1px solid var(--fx-border);
    background: var(--fx-panel);
}

textarea.ant-input,
.ant-input[type="password"],
.ant-input[type="text"] {
    min-height: 32px;
}

textarea.ant-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 1280px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .thing-layout {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .thing-global-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

@media (max-width: 920px) {
    .app-shell,
    .app-shell.is-collapsed {
        grid-template-columns: 1fr;
    }

    .app-sider {
        position: sticky;
        top: 0;
        z-index: 90;
        border-right: none;
        border-bottom: 1px solid var(--fx-border);
    }

    .app-shell.is-collapsed .app-sider {
        align-items: stretch;
    }

    .app-main {
        padding: 10px;
    }

    .tab-workspace,
    .page-header,
    .thing-panel-toolbar,
    .thing-dashboard-toolbar,
    .group-card-header,
    .section-title-row,
    .share-section-title,
    .share-outer-card header {
        align-items: stretch;
        flex-direction: column;
    }

    .group-card-side {
        justify-items: start;
        min-width: 0;
    }

    .group-card-tags {
        justify-content: flex-start;
    }

    .workspace-left,
    .workspace-user {
        width: 100%;
        justify-content: space-between;
    }

    .workspace-tabs {
        flex: 1;
    }

    .thing-layout {
        grid-template-columns: 1fr;
    }

    .thing-global-layout {
        grid-template-columns: 1fr;
    }

    .thing-tree-panel,
    .thing-side-panel {
        position: static;
    }

    .share-card-grid {
        grid-template-columns: 1fr;
    }
}

.fx-toast-stack {
    position: fixed;
    right: 18px;
    top: 72px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
}

.fx-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    color: var(--fx-text);
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.fx-toast.success .anticon {
    color: #16a34a;
}

.fx-toast.error .anticon {
    color: #dc2626;
}

.fx-toast.info .anticon {
    color: var(--fx-primary);
}

.fx-toast span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.fx-toast button {
    width: 24px;
    height: 24px;
    border: none;
    color: var(--fx-muted);
    background: transparent;
    cursor: pointer;
}

@media (max-width: 620px) {
    .metric-grid,
    .thing-focus-metrics {
        grid-template-columns: 1fr;
    }

    .connection-panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .connection-field-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        align-items: stretch;
    }

    .list-toolbar,
    .thing-panel-toolbar,
    .member-picker-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .list-toolbar-filters,
    .list-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .filter-bar > *,
    .filter-bar .ant-input-group,
    .filter-bar .ant-select,
    .filter-bar .ant-input,
    .filter-bar button,
    .list-toolbar > *,
    .thing-panel-toolbar > *,
    .list-toolbar .ant-input-group,
    .thing-panel-toolbar .ant-input-group,
    .list-toolbar .ant-select,
    .thing-panel-toolbar .ant-select,
    .list-toolbar .ant-input,
    .thing-panel-toolbar .ant-input,
    .list-toolbar button,
    .thing-panel-toolbar button,
    .member-picker-toolbar .ant-input,
    .member-picker-toolbar button,
    .import-upload-button {
        width: 100% !important;
    }

    .workspace-left {
        flex-direction: column;
        align-items: stretch;
    }

    .fx-bar-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .fx-bar-row strong {
        text-align: left;
    }
}

#blazor-error-ui {
    background: #fff7e6;
    border-top: 1px solid #ffd591;
    bottom: 0;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12);
    color: #7c4a03;
    display: none;
    left: 0;
    padding: 10px 16px;
    position: fixed;
    right: 0;
    z-index: 10000;
}

#blazor-error-ui .reload {
    color: #1677ff;
    margin-left: 12px;
}

#blazor-error-ui .dismiss {
    color: inherit;
    cursor: pointer;
    position: absolute;
    right: 16px;
}

.global-search-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: 32px;
    transition: width 0.2s ease;
}

.global-search-wrapper.expanded {
    width: clamp(260px, 28vw, 380px);
}

.global-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    background: var(--fx-panel);
    color: var(--fx-text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.global-search-trigger:hover {
    border-color: var(--fx-primary);
    color: var(--fx-primary);
    background: var(--fx-nav-hover);
}

.global-search-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 32px;
    padding: 0 4px 0 10px;
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 6px;
    color: var(--fx-text-muted);
    box-sizing: border-box;
}

.global-search-inline:focus-within {
    border-color: var(--fx-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--fx-primary) 12%, transparent);
}

.global-search-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--fx-text);
    font: inherit;
    font-size: 13px;
}

.global-search-input::placeholder {
    color: var(--fx-text-muted);
}

.global-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--fx-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.global-search-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: min(440px, calc(100vw - 28px));
    max-height: min(66vh, 560px);
    overflow: hidden;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel);
    box-shadow: var(--fx-shadow);
}

.global-search-close:hover {
    background: var(--fx-panel-muted);
    color: var(--fx-text);
}

.global-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: var(--fx-text-muted);
}

.global-search-empty {
    padding: 32px;
}

.global-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.global-search-section {
    margin-bottom: 12px;
}

.global-search-section:last-child {
    margin-bottom: 0;
}

.global-search-section-title {
    font-size: 12px;
    color: var(--fx-text-muted);
    font-weight: 500;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.global-search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.global-search-result-item:hover {
    background: var(--fx-nav-hover);
}

.global-search-result-item.active {
    background: var(--fx-nav-icon-active);
}

.global-search-result-info {
    flex: 1;
    min-width: 0;
}

.global-search-result-name {
    font-size: 14px;
    color: var(--fx-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result-meta {
    font-size: 12px;
    color: var(--fx-text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid var(--fx-border);
    background: var(--fx-panel-muted);
    font-size: 12px;
    color: var(--fx-text-muted);
}

@media (max-width: 920px) {
    .global-search-wrapper.expanded {
        width: min(360px, calc(100vw - 180px));
    }
}

.alarm-level-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.alarm-level-tag svg {
    width: 14px;
    height: 14px;
}

/* ===== 指标卡 ===== */
.metric-card {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    padding: 13px 14px;
    min-width: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--fx-elevation-sm);
    transition:
        background-color var(--fx-theme-transition),
        border-color 0.15s ease,
        color var(--fx-theme-transition),
        box-shadow 0.15s ease;
}

.metric-card:hover {
    box-shadow: var(--fx-elevation-md);
    border-color: color-mix(in srgb, var(--fx-primary) 32%, var(--fx-border));
}

.metric-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    min-height: 20px;
}

.metric-card-label {
    color: var(--fx-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.metric-card-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--fx-text-muted);
}

.metric-card-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fx-success);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-success) 24%, transparent);
    animation: status-pulse 2s ease-in-out infinite;
}

.metric-card-status .status-dot.offline {
    background: var(--fx-text-muted);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-text-muted) 18%, transparent);
    animation: none;
}

.metric-card-status .status-dot.error {
    background: var(--fx-error);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-error) 24%, transparent);
}

.metric-card-status .status-dot.warning {
    background: var(--fx-warning);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-warning) 24%, transparent);
}

@keyframes status-pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-success) 24%, transparent);
    }
    50% {
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--fx-success) 8%, transparent);
    }
}

.metric-card-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--fx-text);
    margin: 2px 0 4px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.metric-card-value-unit {
    font-size: 14px;
    color: var(--fx-text-muted);
    font-weight: 500;
    margin-left: 4px;
}

.metric-card-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    min-height: 16px;
}

.metric-card-trend-text {
    font-size: 12px;
    color: var(--fx-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.metric-card-trend-up {
    color: var(--fx-success);
}

.metric-card-trend-down {
    color: var(--fx-error);
}

.metric-card a {
    color: inherit;
    text-decoration: none;
}

/* ===== 驾驶舱样式 ===== */
.dashboard-metrics {
    margin-bottom: 16px;
}

.dashboard-panel {
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.dashboard-panel:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--fx-border);
    margin-bottom: 0;
}

.dashboard-panel-header h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fx-text);
}

.dashboard-panel-header h2 .anticon {
    color: var(--fx-primary);
    font-size: 16px;
}

.dashboard-panel-header .entity-link {
    font-size: 13px;
}

.dashboard-panel .ant-table-wrapper .ant-table {
    border-radius: 0 0 8px 8px;
}

/* ===== 分组卡片 ===== */
.thing-dashboard-group.group-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid var(--fx-border);
}

.thing-dashboard-group.group-card:hover {
    border-color: color-mix(in srgb, var(--fx-primary) 32%, var(--fx-border));
    box-shadow: 0 3px 10px color-mix(in srgb, var(--fx-text) 8%, transparent);
}

.group-card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--fx-primary) 0%, color-mix(in srgb, var(--fx-primary) 60%, transparent) 100%);
}

.thing-dashboard-group.group-card:nth-child(4n+2) .group-card-stripe {
    background: linear-gradient(180deg, var(--fx-success) 0%, color-mix(in srgb, var(--fx-success) 60%, transparent) 100%);
}

.thing-dashboard-group.group-card:nth-child(4n+3) .group-card-stripe {
    background: linear-gradient(180deg, var(--fx-warning) 0%, color-mix(in srgb, var(--fx-warning) 60%, transparent) 100%);
}

.thing-dashboard-group.group-card:nth-child(4n+4) .group-card-stripe {
    background: linear-gradient(180deg, #722ed1 0%, color-mix(in srgb, #722ed1 60%, transparent) 100%);
}

.group-card-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 10px 22px;
    width: 100%;
}

.group-card-content h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.group-card-content p {
    margin: 4px 0 0;
    color: var(--fx-text-muted);
    font-size: 12px;
}

.dashboard-widget h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fx-text);
    margin: 0 0 10px;
    padding-left: 4px;
    border-left: 3px solid var(--fx-primary);
    padding: 2px 0 2px 8px;
}

.dashboard-widget h3 .anticon {
    color: var(--fx-primary);
}

.dashboard-widget {
    padding: 14px 18px;
    border-bottom: 1px dashed var(--fx-border);
}

.dashboard-widget:last-child {
    border-bottom: none;
}

/* ===== 趋势图增强 ===== */
.trend-chart-enhanced {
    position: relative;
}

.trend-chart-enhanced svg {
    border-radius: 6px;
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--fx-primary) 3%, transparent) 100%);
}

.trend-grid {
    stroke: var(--fx-border);
    stroke-width: 0.1;
    stroke-dasharray: 0.5 0.5;
    opacity: 0.7;
}

.trend-axis-line {
    stroke: var(--fx-border);
    stroke-width: 0.2;
}

.trend-series-line {
    fill: none;
    stroke-width: 0.5;
    transition: stroke-width 0.2s ease;
    filter: drop-shadow(0 0 0.5px color-mix(in srgb, currentColor 50%, transparent));
}

.trend-series-line:hover {
    stroke-width: 0.8;
}

.trend-series-line.point {
    stroke-width: 0.4;
}

.trend-series-line.stat {
    stroke-width: 0.6;
    stroke-dasharray: 1.5 0.8;
}

.trend-series-line.stat.avg {
    stroke-dasharray: 0;
}

.trend-hover-line {
    stroke: var(--fx-primary);
    stroke-width: 0.15;
    stroke-dasharray: 0.4 0.4;
    opacity: 0.6;
}

.trend-tooltip {
    position: absolute;
    transform: translate(-50%, -100%);
    margin-top: -8px;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 140px;
    max-width: 280px;
}

.trend-tooltip::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: rgba(15, 23, 42, 0.95);
}

.trend-tooltip-time {
    font-weight: 600;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    padding-bottom: 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trend-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.trend-tooltip-row i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.trend-tooltip-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trend-tooltip-value {
    font-weight: 600;
    color: #ffffff;
    margin-left: auto;
}

.trend-series-legend .trend-legend-item {
    cursor: pointer;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.trend-series-legend .trend-legend-item:hover {
    background: var(--fx-nav-hover);
}

/* ===== 登录页重构 ===== */
.login-container {
    display: flex;
    min-height: 100vh;
    background: var(--fx-panel);
}

.login-brand {
    position: relative;
    flex: 1.1;
    margin: 0;
    background: linear-gradient(135deg, #1677ff 0%, #722ed1 50%, #13c2c2 100%);
    color: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.login-brand-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 42%, #000 28%, transparent 76%);
    mask-image: radial-gradient(ellipse 120% 90% at 50% 42%, #000 28%, transparent 76%);
}

.login-scope {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 7%;
    height: 220px;
}

.login-waveform {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.login-scanline {
    position: absolute;
    top: -12%;
    bottom: -12%;
    left: -120px;
    width: 120px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(190, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 100%);
    animation: login-scan-sweep 6.5s linear infinite;
}

@keyframes login-scan-sweep {
    0% { left: -120px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.login-radar {
    position: absolute;
    top: 4%;
    right: 3%;
    width: 300px;
    height: 300px;
    opacity: 0.16;
    animation: login-radar-breathe 9s ease-in-out infinite;
}

@keyframes login-radar-breathe {
    0%, 100% { opacity: 0.13; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.03); }
}

.login-widget {
    position: absolute;
    width: 158px;
    padding: 12px 12px 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.login-widget svg {
    display: block;
    width: 100%;
    height: 74px;
}

.login-widget-hydro {
    top: 11%;
    left: 7%;
    animation: login-widget-float 8s ease-in-out infinite;
}

.login-widget-wind {
    top: 13%;
    right: 7%;
    animation: login-widget-float 8s ease-in-out infinite 2.5s;
}

@keyframes login-widget-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: login-particle-float 12s ease-in-out infinite;
}

.login-particle.p1 { top: 15%; left: 20%; animation-delay: 0s; }
.login-particle.p2 { top: 35%; left: 70%; width: 12px; height: 12px; animation-delay: 2s; }
.login-particle.p3 { top: 65%; left: 30%; width: 6px; height: 6px; animation-delay: 4s; }
.login-particle.p4 { top: 75%; left: 80%; animation-delay: 6s; }
.login-particle.p5 { top: 25%; left: 50%; width: 10px; height: 10px; animation-delay: 8s; }

@keyframes login-particle-float {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.4;
    }
    25% {
        transform: translate(20px, -30px);
        opacity: 0.8;
    }
    50% {
        transform: translate(-15px, -50px);
        opacity: 0.6;
    }
    75% {
        transform: translate(25px, -20px);
        opacity: 0.5;
    }
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 22px;
    color: #ffffff;
    margin-bottom: 26px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

.login-logo-mark {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
}

.login-brand h1 {
    font-size: 56px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: -1px;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.login-subtitle {
    font-size: 18px;
    margin: 0 0 18px;
    opacity: 0.9;
}

.login-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    margin-bottom: 34px;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.login-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.login-features li:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(4px);
}

.login-form-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: var(--fx-panel);
}

.login-form-content {
    width: 100%;
    max-width: 400px;
}

.login-form-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--fx-text);
    letter-spacing: -0.5px;
}

.login-form-tip {
    color: var(--fx-text-muted);
    margin: 0 0 14px;
    font-size: 14px;
}

.login-default-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    margin: 0 0 26px;
    font-size: 13px;
    color: var(--fx-text-muted);
    background: color-mix(in srgb, var(--fx-primary) 7%, var(--fx-panel));
    border: 1px solid color-mix(in srgb, var(--fx-primary) 22%, transparent);
    border-radius: 8px;
}

.login-default-hint b {
    color: var(--fx-text);
    font-weight: 600;
}

.login-default-hint .anticon {
    color: var(--fx-primary);
    flex: 0 0 auto;
}

.login-expired {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    margin: 0 0 26px;
    font-size: 13px;
    color: color-mix(in srgb, var(--fx-warning) 80%, var(--fx-text));
    background: color-mix(in srgb, var(--fx-warning) 10%, var(--fx-panel));
    border: 1px solid color-mix(in srgb, var(--fx-warning) 32%, transparent);
    border-radius: 8px;
}

.login-expired .anticon {
    color: var(--fx-warning);
    flex: 0 0 auto;
}

.login-form-field {
    margin-bottom: 22px;
    position: relative;
}

.login-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--fx-text);
    margin-bottom: 8px;
}

.login-form-field input {
    width: 100%;
    height: 48px;
    border-radius: 10px;
}

.login-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 20px;
}

.login-forgot {
    color: var(--fx-primary);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.login-forgot:hover {
    opacity: 0.7;
}

.login-submit.ant-btn {
    height: 48px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fx-primary), color-mix(in srgb, var(--fx-primary) 70%, #722ed1));
    border: none;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--fx-primary) 24%, transparent);
    transition: all 0.2s ease;
}

.login-submit.ant-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--fx-primary) 32%, transparent);
}

.login-submit.ant-btn:active {
    transform: translateY(0);
}

.login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--fx-error) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--fx-error) 30%, transparent);
    border-radius: 8px;
    color: var(--fx-error);
    font-size: 13px;
    margin-top: 16px;
}

.login-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--fx-text-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
    }
    .login-brand {
        flex: 0 0 auto;
        padding: 40px 24px;
    }
    .login-brand h1 {
        font-size: 36px;
    }
    .login-features {
        display: none;
    }
    .login-radar,
    .login-widget {
        display: none;
    }
    .login-form-wrapper {
        padding: 40px 24px;
    }
}

/* ===== 表格滚动 ===== */
.ant-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--fx-border) transparent;
}

.ant-table-wrapper .ant-table-content,
.ant-table-wrapper .ant-table-body {
    overflow-x: auto !important;
}

.ant-table-wrapper::-webkit-scrollbar,
.ant-table-wrapper .ant-table-content::-webkit-scrollbar,
.ant-table-wrapper .ant-table-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ant-table-wrapper::-webkit-scrollbar-thumb,
.ant-table-wrapper .ant-table-content::-webkit-scrollbar-thumb,
.ant-table-wrapper .ant-table-body::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--fx-border);
}

/* 表格增强 ===== */
.ant-table-wrapper .ant-table {
    border-radius: 8px;
    overflow: hidden;
}

.ant-table-wrapper .ant-table-thead > tr > th {
    background: var(--fx-panel-muted) !important;
    color: var(--fx-text) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-bottom: 2px solid var(--fx-border) !important;
    padding: 8px 12px !important;
}

.ant-table-wrapper .ant-table-tbody > tr > td {
    border-bottom: 1px solid var(--fx-border) !important;
    padding: 10px 12px !important;
    transition: background 0.15s ease;
}

.ant-table-wrapper .ant-table-tbody > tr:hover > td,
.ant-table-wrapper .ant-table-tbody > tr.ant-table-row-hover > td {
    background: var(--fx-nav-hover) !important;
}

/* 斑马纹（可选，通过 table-striped 类启用） */
.ant-table-wrapper .ant-table-tbody > tr:nth-child(even) > td {
    background: color-mix(in srgb, var(--fx-panel-muted) 50%, transparent);
}

.ant-table-wrapper .ant-table-tbody > tr:nth-child(even):hover > td {
    background: var(--fx-nav-hover) !important;
}

.ant-table-wrapper .ant-pagination {
    margin: 16px 0 0 !important;
    color: var(--fx-text-muted) !important;
}

.ant-table-wrapper .ant-pagination-item,
.ant-table-wrapper .ant-pagination-prev,
.ant-table-wrapper .ant-pagination-next {
    background: var(--fx-panel) !important;
    border: 1px solid var(--fx-border) !important;
}

.ant-table-wrapper .ant-pagination-item a {
    color: var(--fx-text) !important;
}

.ant-table-wrapper .ant-pagination-item-active {
    background: var(--fx-primary) !important;
    border-color: var(--fx-primary) !important;
}

.ant-table-wrapper .ant-pagination-item-active a {
    color: #ffffff !important;
}

.table-panel {
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: var(--fx-radius-lg);
    padding: var(--fx-space-3);
    box-shadow: var(--fx-elevation-sm);
    transition:
        background-color var(--fx-theme-transition),
        border-color var(--fx-theme-transition),
        color var(--fx-theme-transition),
        box-shadow 0.2s ease;
}

.table-panel h2 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--fx-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-panel h2 .anticon {
    color: var(--fx-primary);
}

/* ===== 空状态美化 ===== */
.ant-empty {
    padding: 32px 16px !important;
}

.ant-empty-img-default-path-1,
.ant-empty-img-default-path-2,
.ant-empty-img-default-path-3 {
    fill: color-mix(in srgb, var(--fx-primary) 30%, transparent);
}

.empty-action {
    text-align: center;
    padding: 32px 16px;
}

.empty-action .ant-btn {
    margin-top: 12px;
}

.empty-illustration {
    max-width: 200px;
    margin: 0 auto 16px;
    opacity: 0.85;
}

.empty-illustration svg {
    width: 100%;
    height: auto;
}

/* 通用友好空状态容器 */
.fx-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.fx-empty-state-title {
    font-size: 15px;
    color: var(--fx-text);
    margin: 12px 0 4px;
    font-weight: 500;
}

.fx-empty-state-desc {
    font-size: 13px;
    color: var(--fx-text-muted);
    margin: 0 0 16px;
}

.fx-empty-state-action {
    margin-top: 8px;
}

/* ===== 报警面板卡片化 ===== */
.alarm-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alarm-card {
    position: relative;
    background: var(--fx-panel);
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.alarm-card:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border-color: color-mix(in srgb, var(--fx-primary) 40%, var(--fx-border));
}

.alarm-card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--fx-warning);
}

.alarm-card-stripe-level-3,
.alarm-card-stripe-level-4 {
    background: linear-gradient(180deg, var(--fx-error) 0%, color-mix(in srgb, var(--fx-error) 60%, transparent) 100%);
}

.alarm-card-stripe-level-2 {
    background: linear-gradient(180deg, var(--fx-warning) 0%, color-mix(in srgb, var(--fx-warning) 60%, transparent) 100%);
}

.alarm-card-stripe-level-1 {
    background: linear-gradient(180deg, #faad14 0%, color-mix(in srgb, #faad14 60%, transparent) 100%);
}

.alarm-card-content {
    padding: 12px 14px 12px 18px;
}

.alarm-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.alarm-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alarm-card-time {
    font-size: 12px;
    color: var(--fx-text-muted);
}

.alarm-card-status {
    font-size: 11px;
    padding: 2px 8px;
}

.alarm-card-message {
    font-size: 14px;
    color: var(--fx-text);
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.4;
}

.alarm-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--fx-text-muted);
    margin-bottom: 10px;
}

.alarm-card-target {
    padding: 2px 6px;
    background: var(--fx-panel-muted);
    border-radius: 4px;
}

.alarm-card-value {
    opacity: 0.85;
}

.alarm-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.alarm-card-action-btn {
    font-size: 12px;
    padding: 3px 10px;
}

.alarm-message {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 主题过渡与键盘可达性 ===== */
.app-main,
.tab-workspace,
.workspace-tab,
.page-header,
.dashboard-panel,
.detail-context-actions,
.thing-global-toolbar {
    transition:
        background-color var(--fx-theme-transition),
        border-color var(--fx-theme-transition),
        color var(--fx-theme-transition),
        box-shadow var(--fx-theme-transition);
}

:where(
    a,
    button,
    input,
    select,
    textarea,
    [role="button"],
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 2px solid var(--fx-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .app-shell,
    .app-sider,
    .app-main,
    .tab-workspace,
    .workspace-tab,
    .page-header,
    .metric-card,
    .table-panel,
    .dashboard-panel,
    .detail-context-actions,
    .thing-global-toolbar {
        transition-duration: 0.01ms !important;
    }
}

/* ===== FxIoT 工作台视觉收敛 ===== */
.page-header {
    align-items: center;
    min-height: 44px;
    margin-bottom: 12px;
}

.page-header h1 {
    line-height: 1.35;
    letter-spacing: 0;
}

.page-header p {
    max-width: 760px;
}

.metric-card > strong {
    margin-top: 8px;
    font-size: 28px;
    line-height: 1.25;
    letter-spacing: 0;
}

.metric-card > small {
    min-height: 18px;
}

.metric-card.metric-card-success {
    border-left: 3px solid var(--fx-success);
}

.metric-card.metric-card-warning {
    border-left: 3px solid var(--fx-warning);
}

.metric-card.metric-card-error {
    border-left: 3px solid var(--fx-error);
}

.dashboard-panel-header {
    min-height: 48px;
    padding: 9px 12px;
}

.dashboard-panel-header h2 {
    letter-spacing: 0;
}

.thing-global-toolbar {
    margin-bottom: 10px;
    background: var(--fx-panel);
}

.thing-list-panel {
    overflow: hidden;
}

.thing-list-panel .ant-table {
    min-width: 820px;
}

.thing-side-panel {
    overflow: hidden;
}

.thing-side-panel .thing-workspace-section > h2 {
    margin-bottom: 10px;
}

.thing-side-heading {
    padding: 11px;
}

.thing-focus-actions {
    flex-wrap: wrap;
}

.detail-context-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin: -2px 0 10px;
    padding: 9px 10px;
    border: 1px solid var(--fx-border);
    border-radius: 8px;
    background: var(--fx-panel);
}

.detail-tabs > .ant-tabs-nav {
    margin-bottom: 10px;
}

.ingestion-tabs > .ant-tabs-nav {
    margin-bottom: 10px;
    padding: 4px;
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.ingestion-tabs > .ant-tabs-nav::before {
    border-bottom: 0;
}

.ingestion-tabs > .ant-tabs-nav .ant-tabs-tab {
    margin: 0 3px 0 0;
    padding: 7px 12px;
    border-radius: 6px;
}

.ingestion-tabs > .ant-tabs-nav .ant-tabs-tab-active {
    background: var(--fx-panel);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--fx-text) 8%, transparent);
}

.ingestion-tabs > .ant-tabs-nav .ant-tabs-ink-bar {
    display: none;
}

.runtime-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.share-summary-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.share-mode-strip {
    padding: 4px;
    margin: 0 0 10px;
    border-radius: 8px;
    background: var(--fx-panel-muted);
}

.share-mode-strip span {
    padding-left: 6px;
}

.share-mode-strip button {
    border-color: transparent;
    background: transparent;
}

.share-mode-strip button.active,
.share-mode-strip button:hover {
    border-color: var(--fx-border);
    background: var(--fx-panel);
}

.share-view-switch {
    padding: 3px;
    border: 0;
    background: var(--fx-panel-muted);
}

.share-view-switch button {
    min-width: 76px;
    border: 0;
    border-radius: 5px;
}

.share-view-switch button.active {
    color: var(--fx-primary);
    background: var(--fx-panel);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--fx-text) 8%, transparent);
}

.share-outer-card {
    padding: 12px;
}

.share-point-card {
    border-left-width: 1px;
    border-radius: 6px;
    background: var(--fx-bg);
}

.theme-techblue .metric-card,
.theme-techblue .table-panel,
.theme-techblue .share-outer-card,
.theme-techblue .detail-context-actions {
    box-shadow: 0 2px 10px rgba(0, 9, 22, 0.18);
}

.theme-techblue .metric-card:hover,
.theme-techblue .table-panel:hover {
    border-color: color-mix(in srgb, var(--fx-primary) 48%, var(--fx-border));
}

.theme-techblue .ant-pagination-prev .ant-pagination-item-link,
.theme-techblue .ant-pagination-next .ant-pagination-item-link {
    color: var(--fx-text-muted) !important;
    border-color: var(--fx-border) !important;
    background: var(--fx-panel) !important;
}

@media (min-width: 761px) {
    .thing-panel-toolbar .list-toolbar-filters {
        flex-wrap: nowrap;
    }
}

@media (max-width: 1280px) {
    .metric-grid,
    .runtime-metrics,
    .share-summary-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

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

@media (max-width: 1100px) {
    .metric-grid,
    .runtime-metrics,
    .share-summary-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .detail-grid,
    .thing-global-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .thing-side-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .page-header,
    .thing-global-toolbar,
    .detail-context-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header > .ant-space,
    .detail-context-actions {
        justify-content: flex-start;
    }

    .thing-global-toolbar .list-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .metric-grid,
    .runtime-metrics,
    .share-summary-metrics {
        grid-template-columns: minmax(0, 1fr);
    }
}
