:root {
    --sx-bg: #edf2f4;
    --sx-panel: #ffffff;
    --sx-ink: #1b2830;
    --sx-muted: #63727a;
    --sx-line: #d7e0e4;
    --sx-sidebar: #143f4b;
    --sx-sidebar-deep: #0d3039;
    --sx-primary: #167f9c;
    --sx-primary-dark: #0e637c;
    --sx-success: #167e5b;
    --sx-warning: #b87516;
    --sx-danger: #c44747;
    --sx-radius: 8px;
    --sx-shadow: 0 8px 20px rgba(24, 48, 58, 0.08);
}

* { box-sizing: border-box; }

body.sx-app-body {
    background: var(--sx-bg);
    color: var(--sx-ink);
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.sx-loader-overlay {
    align-items: center;
    background: rgba(237, 242, 244, 0.8);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 160ms ease;
    z-index: 1000;
}

.sx-loader-overlay.is-visible { opacity: 1; pointer-events: auto; }
.sx-loader-card {
    background: var(--sx-panel);
    border: 1px solid var(--sx-line);
    border-radius: var(--sx-radius);
    box-shadow: var(--sx-shadow);
    min-width: 230px;
    padding: 24px;
    text-align: center;
}
.sx-loader-card p { color: var(--sx-muted); margin: 8px 0 0; }
.sx-spinner {
    animation: sx-spin 700ms linear infinite;
    border: 3px solid #c9e2e9;
    border-radius: 50%;
    border-top-color: var(--sx-primary);
    display: inline-block;
    height: 28px;
    width: 28px;
}
@keyframes sx-spin { to { transform: rotate(360deg); } }

.sx-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sx-sidebar {
    background: linear-gradient(180deg, var(--sx-sidebar), var(--sx-sidebar-deep));
    color: #e8f4f6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 22px 14px;
    position: sticky;
    top: 0;
}
.sx-sidebar__brand { align-items: center; display: flex; gap: 12px; padding: 0 10px 24px; }
.sx-sidebar__brand strong { display: block; font-size: 15px; }
.sx-sidebar__brand p { color: #aed0d8; font-size: 12px; margin: 2px 0 0; }
.sx-logo-mark {
    align-items: center;
    background: #ebf6f7;
    border-radius: 7px;
    color: var(--sx-sidebar);
    display: flex;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    width: 36px;
}
.sx-nav { display: grid; gap: 5px; }
.sx-nav__link { align-items: center; border-radius: 6px; color: #c8e0e5; display: flex; gap: 12px; min-height: 54px; padding: 9px 11px; }
.sx-nav__link:hover, .sx-nav__link.is-active { background: rgba(235, 246, 247, 0.14); color: #ffffff; }
.sx-nav__link .sx-icon { font-size: 17px; width: 20px; }
.sx-nav__link strong, .sx-nav__link small { display: block; }
.sx-nav__link small { color: inherit; font-size: 11px; opacity: 0.75; }
.sx-sidebar__footer { display: grid; gap: 14px; margin-top: auto; padding: 18px 10px 0; }
.sx-status-chip { align-items: center; color: #b9e6d3; display: flex; font-size: 12px; gap: 7px; }

.sx-main { min-width: 0; padding: 22px 28px 36px; }
.sx-header { align-items: center; display: flex; gap: 20px; justify-content: space-between; margin-bottom: 20px; }
.sx-header__left, .sx-header__right, .sx-inline-actions { align-items: center; display: flex; gap: 10px; }
.sx-header h1 { font-size: 22px; margin: 0; }
.sx-header p { color: var(--sx-muted); font-size: 13px; margin: 2px 0 0; }
.sx-icon-button { align-items: center; background: var(--sx-panel); border: 1px solid var(--sx-line); border-radius: 6px; color: var(--sx-ink); display: inline-flex; height: 36px; justify-content: center; width: 36px; }
.sx-icon-button:hover { background: #f5fafb; border-color: #a8cad3; }
.sx-operator { align-items: center; display: flex; gap: 8px; }
.sx-operator strong, .sx-operator p { display: block; }
.sx-operator p { font-size: 11px; }
.sx-operator__avatar, .sx-avatar { align-items: center; background: #d6edf1; border-radius: 50%; color: var(--sx-primary-dark); display: inline-flex; font-weight: 700; height: 34px; justify-content: center; width: 34px; }

.sx-banner { background: var(--sx-panel); border: 1px solid var(--sx-line); border-left: 4px solid var(--sx-primary); border-radius: var(--sx-radius); display: flex; gap: 20px; justify-content: space-between; margin-bottom: 17px; padding: 16px 18px; }
.sx-banner__main p { color: var(--sx-muted); margin: 5px 0 0; }
.sx-banner__stats { display: flex; gap: 22px; }
.sx-mini-stat { border-left: 1px solid var(--sx-line); min-width: 80px; padding-left: 16px; }
.sx-mini-stat span, .sx-mini-stat small { color: var(--sx-muted); display: block; font-size: 11px; }
.sx-mini-stat strong { display: block; font-size: 18px; }
.sx-breadcrumb { align-items: center; color: var(--sx-muted); display: flex; font-size: 12px; gap: 7px; margin: 0 0 18px; }
.sx-breadcrumb a:hover { color: var(--sx-primary); }

.sx-content, .sx-section { display: grid; gap: 16px; }
.sx-section { margin-bottom: 18px; }
.sx-section__head, .sx-card__head { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.sx-section__head h2 { font-size: 19px; margin: 0; }
.sx-section__head p, .sx-card__head p { color: var(--sx-muted); margin: 4px 0 0; }
.sx-section__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-grid { display: grid; gap: 16px; }
.sx-grid--cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sx-grid--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.sx-grid--pipeline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sx-grid--stats, .sx-grid--roles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sx-card { background: var(--sx-panel); border: 1px solid var(--sx-line); border-radius: var(--sx-radius); box-shadow: var(--sx-shadow); min-width: 0; padding: 18px; }
.sx-card h3 { font-size: 15px; margin: 0; }
.sx-kpi-card { align-items: center; display: flex; gap: 13px; min-height: 112px; }
.sx-kpi-card__icon { align-items: center; background: #e1f0f3; border-radius: 7px; color: var(--sx-primary); display: flex; font-size: 21px; height: 46px; justify-content: center; width: 46px; }
.sx-kpi-card--success .sx-kpi-card__icon { background: #e1f2e9; color: var(--sx-success); }
.sx-kpi-card--warning .sx-kpi-card__icon { background: #f9efd9; color: var(--sx-warning); }
.sx-kpi-card--danger .sx-kpi-card__icon { background: #f8e5e5; color: var(--sx-danger); }
.sx-kpi-card span, .sx-kpi-card small, .sx-stat-card span { color: var(--sx-muted); display: block; }
.sx-kpi-card strong { display: block; font-size: 23px; margin: 2px 0; }
.sx-kpi-card small { color: var(--sx-success); }
.sx-stat-card strong { display: block; font-size: 26px; margin-top: 4px; }
.sx-role-card { border-top: 3px solid transparent; }
.sx-role-card.is-active { border-top-color: var(--sx-primary); }
.sx-role-card p { color: var(--sx-muted); min-height: 42px; }
.sx-caption { color: var(--sx-primary); font-size: 12px; font-weight: 700; }

.sx-btn { align-items: center; border: 1px solid transparent; border-radius: 6px; display: inline-flex; font-weight: 600; gap: 7px; justify-content: center; min-height: 34px; padding: 7px 12px; }
.sx-btn--primary { background: var(--sx-primary); color: #ffffff; }
.sx-btn--primary:hover { background: var(--sx-primary-dark); }
.sx-btn--ghost { background: #ffffff; border-color: var(--sx-line); color: #36515a; }
.sx-btn--ghost:hover { background: #f4f9fa; border-color: #a8cad3; }
.sx-btn--xs { font-size: 12px; min-height: 29px; padding: 4px 8px; }
.sx-btn--block { width: 100%; }

.sx-chart { align-items: end; border-bottom: 1px solid var(--sx-line); display: flex; gap: 10px; height: 182px; margin-top: 20px; padding: 0 6px; }
.sx-chart__item { align-items: center; display: grid; flex: 1; gap: 6px; justify-items: center; }
.sx-chart__bar { background: linear-gradient(180deg, #39a4b8, var(--sx-primary)); border-radius: 4px 4px 0 0; min-height: 7px; transition: height 500ms ease; width: min(100%, 34px); }
.sx-chart__item span { color: var(--sx-muted); font-size: 11px; margin-bottom: 6px; }
.sx-legend-row, .sx-tag-cloud { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 13px; }
.sx-dot { border-radius: 50%; display: inline-block; height: 7px; margin-right: 4px; width: 7px; }
.sx-dot--primary { background: var(--sx-primary); }.sx-dot--success { background: var(--sx-success); }.sx-dot--warning { background: var(--sx-warning); }
.sx-pipeline-card { background: #f5f9fa; border: 1px solid #e0eaed; border-radius: 6px; padding: 11px; }
.sx-pipeline-card span, .sx-server-item p { color: var(--sx-muted); font-size: 12px; }
.sx-pipeline-card strong { display: block; font-size: 20px; margin-top: 3px; }
.sx-server-list { display: grid; gap: 9px; margin-top: 16px; }
.sx-server-item { align-items: center; border-top: 1px solid var(--sx-line); display: flex; justify-content: space-between; padding-top: 9px; }
.sx-server-item p { margin: 2px 0 0; }.sx-server-item > span { color: var(--sx-success); font-weight: 700; }
.sx-timeline { display: grid; gap: 14px; margin-top: 16px; }.sx-timeline__item { display: grid; gap: 10px; grid-template-columns: 48px 1fr; }.sx-timeline__time { color: var(--sx-primary); font-size: 12px; font-weight: 700; }.sx-timeline__item p, .sx-timeline__item small { color: var(--sx-muted); display: block; margin: 2px 0 0; }

.sx-form { display: grid; gap: 14px; }.sx-form__grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }.sx-form__grid--toolbar { grid-template-columns: 2fr 1fr 1fr 1fr; }.sx-field { display: grid; gap: 6px; }.sx-field > span { color: #42575f; font-size: 12px; font-weight: 700; }.sx-field--full { grid-column: 1 / -1; }.sx-field--actions { align-content: start; }.sx-input-wrap { position: relative; }.sx-input-wrap .sx-icon { color: var(--sx-muted); left: 11px; position: absolute; top: 12px; }.sx-input-wrap input { padding-left: 34px; }
.sx-field input, .sx-field select, .sx-field textarea { background: #ffffff; border: 1px solid #cbd8dd; border-radius: 6px; color: var(--sx-ink); min-height: 39px; outline: none; padding: 8px 10px; width: 100%; }.sx-field textarea { min-height: 94px; resize: vertical; }.sx-field input:focus, .sx-field select:focus, .sx-field textarea:focus { border-color: var(--sx-primary); box-shadow: 0 0 0 3px rgba(22, 127, 156, 0.12); }

.sx-table-wrap { overflow-x: auto; position: relative; }.sx-table { border-collapse: collapse; margin-top: 15px; min-width: 680px; width: 100%; }.sx-table th { background: #f2f7f8; color: #49616a; font-size: 12px; text-align: left; }.sx-table th, .sx-table td { border-bottom: 1px solid var(--sx-line); padding: 11px 10px; }.sx-table tbody tr:hover { background: #f7fbfc; }.sx-table--compact th, .sx-table--compact td { text-align: center; }.sx-table--compact th:first-child, .sx-table--compact td:first-child { text-align: left; }.sx-user-cell { align-items: center; display: flex; gap: 9px; }.sx-user-cell strong, .sx-user-cell small { display: block; }.sx-user-cell small { color: var(--sx-muted); font-size: 11px; }.sx-avatar { height: 30px; width: 30px; }
.sx-tag { border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 700; line-height: 1; padding: 6px 8px; }.sx-tag--success { background: #e2f4ea; color: #126447; }.sx-tag--info { background: #e3f1f5; color: #176d84; }.sx-tag--warning { background: #fbf1dd; color: #926010; }.sx-tag--danger { background: #f8e4e4; color: #a63232; }
.sx-empty-state { color: var(--sx-muted); padding: 32px; text-align: center; }.is-hidden { display: none !important; }

.sx-check-list, .sx-permission-tree { display: grid; gap: 10px; }.sx-check-list__item, .sx-check-list__info, .sx-switch-row { align-items: center; border-bottom: 1px solid var(--sx-line); display: flex; gap: 9px; min-height: 37px; padding-bottom: 8px; }.sx-check-list__item:last-child, .sx-check-list__info:last-child, .sx-switch-row:last-child { border-bottom: 0; }.sx-check-list__info { justify-content: space-between; }.sx-check-list__info span { color: var(--sx-muted); font-size: 12px; }.sx-switch-row input { height: 0; opacity: 0; position: absolute; width: 0; }.sx-switch { background: #b9c7cc; border-radius: 999px; height: 20px; position: relative; transition: background 150ms ease; width: 36px; }.sx-switch::after { background: #ffffff; border-radius: 50%; content: ""; height: 14px; left: 3px; position: absolute; top: 3px; transition: transform 150ms ease; width: 14px; }.sx-switch-row input:checked + .sx-switch { background: var(--sx-success); }.sx-switch-row input:checked + .sx-switch::after { transform: translateX(16px); }.sx-switch-row--compact { border: 0; justify-content: center; padding: 0; }

.sx-tabs__nav { border-bottom: 1px solid var(--sx-line); display: flex; gap: 8px; margin-bottom: 18px; }.sx-tabs__button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--sx-muted); padding: 9px 12px; }.sx-tabs__button.is-active { border-bottom-color: var(--sx-primary); color: var(--sx-primary-dark); font-weight: 700; }.sx-tabs__panel { display: none; }.sx-tabs__panel.is-active { display: block; }

.sx-modal { align-items: center; background: rgba(13, 48, 57, 0.42); display: none; inset: 0; justify-content: center; padding: 18px; position: fixed; z-index: 1100; }.sx-modal.is-open { display: flex; }.sx-modal__dialog { background: #ffffff; border-radius: var(--sx-radius); box-shadow: 0 18px 40px rgba(13, 48, 57, 0.25); max-width: 620px; width: 100%; }.sx-modal__header, .sx-modal__footer { align-items: center; display: flex; gap: 12px; justify-content: space-between; padding: 16px 18px; }.sx-modal__header { border-bottom: 1px solid var(--sx-line); }.sx-modal__header h3, .sx-modal__header p { margin: 0; }.sx-modal__header p { color: var(--sx-muted); font-size: 12px; margin-top: 3px; }.sx-modal__body { padding: 18px; }.sx-modal__footer { border-top: 1px solid var(--sx-line); justify-content: flex-end; }
.sx-toast-stack { bottom: 20px; display: grid; gap: 8px; position: fixed; right: 20px; z-index: 1200; }.sx-toast { animation: sx-toast-in 180ms ease both; background: #173d48; border-left: 4px solid #45b39a; border-radius: 6px; box-shadow: var(--sx-shadow); color: #ffffff; max-width: 320px; padding: 11px 14px; }.sx-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 160ms ease, transform 160ms ease; }@keyframes sx-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

body.sx-sidebar-collapsed .sx-shell { grid-template-columns: 78px minmax(0, 1fr); }body.sx-sidebar-collapsed .sx-sidebar__brand > div:not(.sx-logo-mark), body.sx-sidebar-collapsed .sx-nav__link span:not(.sx-icon), body.sx-sidebar-collapsed .sx-sidebar__footer > *:not(.sx-status-chip) { display: none; }body.sx-sidebar-collapsed .sx-sidebar { align-items: center; padding-inline: 10px; }body.sx-sidebar-collapsed .sx-sidebar__brand { padding-inline: 0; }body.sx-sidebar-collapsed .sx-nav__link { justify-content: center; width: 48px; }

@media (max-width: 1120px) { .sx-grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }.sx-form__grid--toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }.sx-banner__stats { gap: 12px; } }
@media (max-width: 860px) { .sx-shell { grid-template-columns: 1fr; }.sx-sidebar { display: none; position: fixed; width: 272px; z-index: 1050; }.sx-sidebar.is-open { display: flex; }.sx-main { padding: 18px; }body.sx-sidebar-collapsed .sx-shell { grid-template-columns: 1fr; }body.sx-sidebar-collapsed .sx-sidebar { align-items: stretch; padding-inline: 14px; }body.sx-sidebar-collapsed .sx-sidebar__brand > div:not(.sx-logo-mark), body.sx-sidebar-collapsed .sx-nav__link span:not(.sx-icon), body.sx-sidebar-collapsed .sx-sidebar__footer > *:not(.sx-status-chip) { display: block; }body.sx-sidebar-collapsed .sx-nav__link { justify-content: flex-start; width: auto; }.sx-grid--2col { grid-template-columns: 1fr; }.sx-banner { align-items: flex-start; flex-direction: column; }.sx-header__right .sx-btn { display: none; } }
@media (max-width: 600px) { .sx-main { padding: 14px; }.sx-header { align-items: flex-start; }.sx-header h1 { font-size: 19px; }.sx-operator > div:last-child { display: none; }.sx-grid--cards, .sx-grid--stats, .sx-grid--roles, .sx-grid--pipeline, .sx-form__grid, .sx-form__grid--toolbar { grid-template-columns: 1fr; }.sx-banner__stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }.sx-mini-stat { min-width: 0; padding-left: 8px; }.sx-section__head, .sx-card__head { flex-direction: column; }.sx-section__actions { width: 100%; }.sx-section__actions .sx-btn { flex: 1; }.sx-toast-stack { left: 14px; right: 14px; }.sx-toast { max-width: none; } }
