:root {
    --bg: #f2f6fc;
    --sidebar: #324157;
    --sidebar-deep: #263445;
    --sidebar-active: #1f2d3d;
    --sidebar-line: rgba(255, 255, 255, 0.08);
    --panel: #ffffff;
    --panel-border: #ebeef5;
    --panel-shadow: 0 2px 8px rgba(31, 45, 61, 0.04);
    --text: #303133;
    --title: #1f2d3d;
    --muted: #909399;
    --primary: #409eff;
    --primary-deep: #2f8df0;
    --primary-light: #ecf5ff;
    --success: #67c23a;
    --success-light: #f0f9eb;
    --danger: #f56c6c;
    --danger-light: #fef0f0;
    --warning-light: #fdf6ec;
    --line: #edf2f7;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    cursor: default;
}

body * {
    cursor: default;
}

body *:not(input):not(textarea):not(select) {
    caret-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.btn,
a[href],
summary,
details > summary,
label.checkbox-row,
input[type="checkbox"],
input[type="radio"],
input[type="file"],
select,
label[for] {
    cursor: pointer !important;
}

input:not([type]),
input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
textarea {
    cursor: text !important;
    caret-color: currentColor !important;
    user-select: text;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    caret-color: currentColor !important;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed !important;
}

table,
thead th,
tbody td,
.table-title-block h2,
.table-title-block p,
.operator-tag,
.status-tag,
.table-note,
.count,
.hint,
.metric-card,
.metric-card *,
.content-head,
.content-head *,
.flash,
.flash *,
.empty {
    cursor: default;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 236px;
    flex: 0 0 236px;
    background: var(--sidebar);
    color: rgba(255, 255, 255, 0.82);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 16px;
    border-bottom: 1px solid var(--sidebar-line);
}

.brand-mark {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    border: 1.6px solid rgba(255, 255, 255, 0.82);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
}

.brand-mark-plus::before {
    top: 3px;
    left: 8px;
    width: 1.6px;
    height: 9px;
}

.brand-mark-plus::after {
    top: 7px;
    left: 4px;
    width: 9px;
    height: 1.6px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-copy strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.brand-copy span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 10.5px;
    line-height: 1.2;
}

.nav {
    padding: 6px 0 14px;
}

.nav-section {
    margin-bottom: 0;
}

.nav-section-system {
    margin-top: 6px;
}

.nav-link,
.nav-link-anchor {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 0 18px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    text-align: left;
}

.nav-link > span:last-child,
.nav-link-anchor > span:last-child {
    font-size: 14px;
    font-weight: 500;
}

.nav-link {
    cursor: pointer;
    user-select: none;
}

.nav-link-anchor,
.nav-sublink {
    cursor: pointer;
    user-select: none;
}

.nav-link::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.4px solid rgba(255, 255, 255, 0.46);
    border-bottom: 1.4px solid rgba(255, 255, 255, 0.46);
    transform: translateY(-70%) rotate(45deg);
}

.nav-link.is-open::after {
    transform: translateY(-30%) rotate(225deg);
}

.nav-link-anchor.is-selected {
    background: rgba(0, 0, 0, 0.18);
    color: #4ca2ff;
}

.nav-link-anchor.is-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.nav-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: 0.9;
}

.nav-icon::before,
.nav-icon::after {
    content: "";
    position: absolute;
}

.nav-icon-device::before {
    inset: 2px;
    border: 1.8px solid currentColor;
    border-radius: 4px;
}

.nav-icon-device::after {
    top: 7px;
    left: -2px;
    width: 24px;
    height: 6px;
    border-top: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
}

.nav-icon-shield::before {
    left: 3px;
    top: 1px;
    width: 14px;
    height: 16px;
    border: 1.8px solid currentColor;
    clip-path: polygon(0 0, 100% 0, 100% 56%, 50% 100%, 0 56%);
    border-radius: 7px 7px 9px 9px;
}

.nav-icon-phone::before {
    inset: 1px 5px;
    border: 1.8px solid currentColor;
    border-radius: 4px;
}

.nav-icon-phone::after {
    left: 8px;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
}

.nav-icon-call::before {
    left: 2px;
    top: 6px;
    width: 16px;
    height: 8px;
    border: 1.8px solid currentColor;
    border-radius: 10px;
    transform: rotate(-25deg);
}

.nav-icon-briefcase::before {
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 12px;
    border: 1.8px solid currentColor;
    border-radius: 3px;
}

.nav-icon-briefcase::after {
    top: 1px;
    left: 6px;
    width: 8px;
    height: 5px;
    border: 1.8px solid currentColor;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
}

.nav-icon-bill::before {
    inset: 1px 4px;
    border: 1.8px solid currentColor;
    border-radius: 2px;
}

.nav-icon-bill::after {
    top: 6px;
    left: 7px;
    width: 6px;
    height: 1.8px;
    background: currentColor;
    box-shadow: 0 4px 0 currentColor;
}

.nav-icon-user::before {
    top: 1px;
    left: 6px;
    width: 8px;
    height: 8px;
    border: 1.8px solid currentColor;
    border-radius: 50%;
}

.nav-icon-user::after {
    left: 3px;
    bottom: 1px;
    width: 14px;
    height: 7px;
    border: 1.8px solid currentColor;
    border-radius: 10px 10px 3px 3px;
}

.nav-icon-gear::before {
    inset: 4px;
    border: 1.8px solid currentColor;
    border-radius: 50%;
}

.nav-icon-gear::after {
    inset: 0;
    border-radius: 50%;
    box-shadow:
        0 -9px 0 -7px currentColor,
        0 9px 0 -7px currentColor,
        9px 0 0 -7px currentColor,
        -9px 0 0 -7px currentColor;
}

.nav-submenu {
    background: rgba(0, 0, 0, 0.12);
    padding: 2px 0 4px;
}

.nav-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 18px 0 48px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
    transition: background 0.16s ease, color 0.16s ease;
}

.nav-sublink:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.nav-sublink.is-active {
    background: var(--sidebar-active);
    color: #4aa2ff;
    font-weight: 500;
}

.nav-sublink.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.nav-subicon {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    opacity: 0.92;
}

.nav-subicon::before,
.nav-subicon::after {
    content: "";
    position: absolute;
}

.nav-subicon-phone::before {
    inset: 1px 4px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
}

.nav-subicon-phone::after {
    left: 7px;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
}

.nav-subicon-sync::before {
    left: 2px;
    top: 3px;
    width: 10px;
    height: 10px;
    border: 1.6px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
}

.nav-subicon-sync::after {
    right: 1px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border: 1.6px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
}

.nav-subicon-filter::before {
    left: 2px;
    right: 2px;
    top: 4px;
    height: 1.6px;
    background: currentColor;
    box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.nav-subicon-filter::after {
    top: 2px;
    left: 4px;
    width: 4px;
    height: 4px;
    border: 1.6px solid currentColor;
    border-radius: 50%;
    background: var(--sidebar-active);
    box-shadow: 6px 4px 0 -1px var(--sidebar-active), 10px 8px 0 -1px var(--sidebar-active);
}

.nav-subicon-list::before {
    left: 2px;
    top: 3px;
    width: 12px;
    height: 12px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
    transform: rotate(-18deg);
}

.nav-subicon-list::after {
    top: 7px;
    right: 1px;
    width: 6px;
    height: 6px;
    border: 1.6px solid currentColor;
    border-radius: 2px;
}

.nav-subicon-rate::before {
    left: 2px;
    bottom: 3px;
    width: 3px;
    height: 8px;
    background: currentColor;
    border-radius: 999px;
    box-shadow: 5px -3px 0 currentColor, 10px -6px 0 currentColor;
}

.nav-subicon-rate::after {
    right: 0;
    top: 3px;
    width: 6px;
    height: 6px;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(45deg);
}

.sidebar-mask {
    display: none;
}

.main-shell {
    min-width: 0;
    flex: 1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 22px 0 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--panel-border);
    user-select: none;
}

@media (min-width: 961px) {
    .app-shell {
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .nav {
        flex: 1;
        overflow-y: auto;
    }

    .main-shell {
        width: calc(100% - 236px);
        height: 100vh;
        margin-left: 236px;
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 100;
        flex: 0 0 auto;
    }

    .content {
        flex: 1 0 auto;
    }

    body.page-numbers .content {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 56px);
        overflow: hidden;
    }

    body.page-numbers .content-head,
    body.page-numbers .query-panel {
        flex: 0 0 auto;
    }

    body.page-numbers .table-panel {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    body.page-numbers .table-panel > form {
        display: flex;
        flex: 1 1 auto;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
    }

    body.page-numbers .table-panel > form > .table-header,
    body.page-numbers .table-panel > form > .flash,
    body.page-numbers .table-panel > form > .flash-block {
        flex: 0 0 auto;
    }

    body.page-numbers .table-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: auto;
        overflow-y: auto;
    }

    body.page-numbers .table-footer {
        flex: 0 0 auto;
        margin-top: auto;
        background: #ffffff;
        border-top: 1px solid var(--line);
    }

    body.page-numbers .numbers-table thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #fbfdff;
    }
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-left,
.topbar-right,
.page-path,
.page-path *,
.company-chip,
.company-chip *,
.user-chip,
.user-chip *,
.topbar-divider {
    cursor: default;
    user-select: none;
}

.menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #303133;
}

.page-path {
    color: #909399;
    font-size: 14px;
}

.page-path strong {
    color: var(--title);
}

.page-path-separator {
    margin: 0 10px;
}

.company-chip,
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #606266;
    font-size: 14px;
    cursor: default;
    user-select: none;
}

.company-chip {
    max-width: 380px;
    white-space: nowrap;
}

.company-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #909399;
}

.topbar-divider {
    width: 1px;
    height: 18px;
    background: #e8edf3;
}

.user-chip-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.user-chip-compact {
    gap: 8px;
    color: #667181;
}

.user-chip-name {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7c8796;
    font-size: 14px;
    user-select: none;
}

.logout-link,
.logout-link * {
    cursor: pointer;
}

.logout-link:hover {
    color: var(--primary);
}

.logout-icon {
    position: relative;
    width: 14px;
    height: 14px;
}

.logout-icon::before,
.logout-icon::after {
    content: "";
    position: absolute;
}

.logout-icon::before {
    left: 1px;
    top: 2px;
    width: 8px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-right: 0;
    border-radius: 3px 0 0 3px;
}

.logout-icon::after {
    right: 0;
    top: 4px;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.content {
    padding: 10px 18px 22px;
}

.content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 2px 0 4px;
}

.content-head-tight {
    margin-bottom: 6px;
    padding: 0;
}

.breadcrumb {
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 14px;
}

.content-head h1 {
    margin: 0;
    color: var(--title);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.content-head p {
    margin: 6px 0 0;
    color: #8ea0b8;
    font-size: 13px;
    line-height: 1.7;
}

.content-head-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 108px;
    padding: 9px 14px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(31, 45, 61, 0.04);
    white-space: nowrap;
}

.metric-card-chip {
    min-width: 96px;
    padding: 7px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(31, 45, 61, 0.03);
}

.metric-card span {
    color: #a0a9b8;
    font-size: 12px;
    line-height: 1;
}

.metric-card-chip span {
    font-size: 11px;
}

.metric-card strong {
    color: var(--title);
    font-size: 16px;
    line-height: 1;
}

.metric-card-chip strong {
    font-size: 15px;
}

.metric-note {
    color: #8ea0b8;
    font-size: 12px;
    white-space: nowrap;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    box-shadow: var(--panel-shadow);
}

.query-panel {
    margin-bottom: 8px;
    padding: 8px 12px 9px;
    overflow-x: hidden;
    overflow-y: hidden;
    --query-label-height: 18px;
    --query-control-height: 38px;
}

.content-head-tight + .query-panel {
    margin-top: 4px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field.compact {
    min-width: 282px;
}

.field label {
    color: #606266;
    font-size: 14px;
    font-weight: 600;
    cursor: default !important;
    user-select: none;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field textarea:focus,
.field select:focus {
    border-color: #b3d8ff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

.field textarea {
    min-height: 168px;
    line-height: 1.7;
    resize: vertical;
}

.query-panel .search-form {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns:
        minmax(0, 1.18fr)
        minmax(0, 0.92fr)
        minmax(0, 0.92fr)
        minmax(0, 0.92fr)
        minmax(0, 1.08fr)
        minmax(0, 1.08fr)
        minmax(124px, 0.78fr);
    gap: 8px;
    align-items: start;
}

.query-panel .field {
    display: grid;
    grid-template-rows: var(--query-label-height) var(--query-control-height);
    gap: 4px;
    min-width: 0;
    width: 100%;
    align-content: start;
}

.query-panel .field.compact {
    min-width: 0;
}

.query-panel .field label {
    color: #8d98aa;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    height: var(--query-label-height);
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.query-panel .query-control {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--query-control-height);
    min-height: var(--query-control-height);
    width: 100%;
    border-color: #d7e0eb;
    border: 1px solid #d7e0eb;
    border-radius: 4px;
    background: #fbfdff;
    box-shadow: none;
    overflow: hidden;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.query-panel .query-control:focus-within {
    border-color: #9cbfe8;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(156, 191, 232, 0.18);
}

.query-panel .query-control input,
.query-panel .query-control select {
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
    outline: none;
    box-shadow: none;
}

.query-panel .query-control input:focus,
.query-panel .query-control select:focus {
    border: 0;
    box-shadow: none;
}

.query-panel .query-control input::placeholder {
    color: #a8b4c5;
}

.query-panel .query-control input[readonly] {
    cursor: pointer;
}

.query-panel .query-control select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 30px;
}

.query-panel .query-control-select::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 1.4px solid #6f7f96;
    border-bottom: 1.4px solid #6f7f96;
    transform: translateY(-62%) rotate(45deg);
    pointer-events: none;
}

.query-panel .query-control-date input {
    padding-right: 10px;
    color-scheme: light;
    cursor: pointer !important;
}

.query-panel .query-control-date {
    cursor: pointer !important;
}

.query-panel .query-control-date input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.78;
}

.query-panel .action-field {
    display: grid;
    grid-template-rows: var(--query-label-height) var(--query-control-height);
    gap: 4px;
    min-width: 0;
    width: 100%;
    align-content: start;
}

.query-panel .action-field-label {
    display: inline-flex;
    align-items: center;
    height: var(--query-label-height);
    margin: 0;
    color: #8d98aa;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.query-panel .search-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    justify-self: stretch;
    align-self: stretch;
    height: var(--query-control-height);
    align-items: stretch;
}

.query-panel .search-actions .btn {
    min-width: 0;
    width: 100%;
    height: var(--query-control-height);
    padding: 0 10px;
    font-size: 11px;
    align-self: stretch;
    justify-content: center;
}

.settings-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #ffffff;
    color: #606266;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn.primary:hover {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}

.btn.minor,
.btn.subtle {
    background: #ffffff;
    border-color: #dcdfe6;
    color: #606266;
}

.btn.minor:hover,
.btn.subtle:hover {
    color: var(--primary);
    border-color: #c6e2ff;
    background: var(--primary-light);
}

.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.btn.danger:hover {
    background: #ef5f5f;
    border-color: #ef5f5f;
}

.btn.action-btn {
    min-width: 90px;
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-xs {
    min-width: 62px;
    height: 30px;
    padding: 0 12px;
}

.table-panel {
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px 8px;
}

.table-title-block h2,
.panel-heading h2 {
    margin: 0;
    color: var(--title);
    font-size: 15px;
    font-weight: 700;
}

.table-title-block p,
.panel-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

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

.batch-status-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 2px;
}

.batch-status-tools select {
    min-width: 148px;
    height: 34px;
    padding: 0 30px 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background-color: #ffffff;
    background-image:
        linear-gradient(45deg, transparent 50%, #7b8797 50%),
        linear-gradient(135deg, #7b8797 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    color: #606266;
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
}

.batch-status-tools select:focus {
    border-color: #b3d8ff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

.flash {
    margin: 0 18px 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
}

.flash-message {
    line-height: 1.7;
}

.flash-details {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(31, 45, 61, 0.08);
}

.flash-detail {
    display: grid;
    gap: 6px;
}

.flash-detail-label {
    font-size: 13px;
    font-weight: 700;
}

.flash-detail-text,
.flash-detail-note {
    line-height: 1.7;
}

.flash-detail-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flash-detail-actions {
    margin-top: 8px;
}

.flash-detail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 116px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(103, 194, 58, 0.24);
    border-radius: 6px;
    background: #ffffff;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
}

.flash-detail-action:hover {
    border-color: rgba(103, 194, 58, 0.38);
    background: rgba(103, 194, 58, 0.08);
}

.flash-detail-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(64, 158, 255, 0.1);
    color: inherit;
    line-height: 1.4;
}

.flash.success {
    color: var(--success);
    background: var(--success-light);
    border-color: #e1f3d8;
}

.flash.success .flash-detail-chip {
    background: rgba(103, 194, 58, 0.1);
}

.flash.error {
    color: var(--danger);
    background: var(--danger-light);
    border-color: #fde2e2;
}

.flash.error .flash-detail-chip {
    background: rgba(245, 108, 108, 0.1);
}

.flash-block {
    margin: 0 0 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.numbers-table thead th,
.numbers-table tbody td {
    text-align: center;
    vertical-align: middle;
}

.numbers-table .check-cell {
    text-align: center;
}

thead th {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fbfdff;
    color: #909399;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: #606266;
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fafcff;
}

.mobile-cell {
    color: #334155;
    font-weight: 600;
}

.check-cell {
    width: 48px;
}

.check-cell input {
    width: 18px;
    height: 18px;
}

.operator-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #edf7ff;
    color: #3688db;
    font-size: 11px;
    font-weight: 600;
}

.operator-tag.unknown {
    background: #f4f4f5;
    color: #909399;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f4f4f5;
    color: #909399;
    font-size: 11px;
    font-weight: 600;
}

.status-tag.success {
    background: #f0f9eb;
    color: #67c23a;
}

.status-tag.custom {
    background: #ecf5ff;
    color: #409eff;
}

.status-tag.muted {
    background: #f4f4f5;
    color: #b1b7c2;
}

.empty {
    padding: 34px 16px;
    color: #a1a8b3;
    text-align: center;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px 14px;
}

.table-footer-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.count {
    color: #8f99a8;
    font-size: 13px;
}

.per-page-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8f99a8;
    font-size: 13px;
}

.per-page-form select {
    min-width: 88px;
    height: 30px;
    padding: 0 30px 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #ffffff;
    color: #606266;
    outline: none;
}

.per-page-form select:focus {
    border-color: #b3d8ff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.12);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #ffffff;
    color: #606266;
    font-size: 13px;
}

.pagination a {
    user-select: none;
}

.pagination a:hover {
    color: var(--primary);
    border-color: #c6e2ff;
}

.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pagination .ellipsis {
    min-width: 24px;
    border-color: transparent;
    background: transparent;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.36);
}

.modal.is-active {
    display: flex;
}

.modal-card {
    position: relative;
    width: min(720px, 100%);
    padding: 30px 34px;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.modal-head {
    margin-bottom: 24px;
}

.modal-head h2 {
    margin: 0 0 10px;
    color: var(--title);
    font-size: 20px;
    text-align: center;
}

.modal-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b8bec8;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.modal-grid {
    display: grid;
    gap: 18px;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.settings-column {
    display: grid;
    gap: 12px;
    align-content: start;
}

.settings-card {
    padding: 16px 16px 14px;
    align-self: start;
}

.settings-card-compact {
    padding-bottom: 12px;
}

.settings-table-card {
    grid-column: 1 / -1;
    padding-top: 0;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.settings-head {
    margin-bottom: 8px;
}

.settings-head h1 {
    font-size: 18px;
}

.settings-head p {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
}

.settings-head .content-head-meta {
    gap: 8px;
}

.settings-card .panel-heading h2 {
    font-size: 15px;
}

.settings-card .panel-heading p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.45;
}

.settings-card .field {
    gap: 5px;
}

.settings-card .field label {
    font-size: 13px;
}

.settings-card .field input:not([type="checkbox"]):not([type="radio"]),
.settings-card .field select {
    min-height: 40px;
    height: 40px;
    padding: 7px 12px;
}

.settings-card .field textarea {
    min-height: 96px;
    padding: 7px 12px;
    line-height: 1.5;
}

.status-options-editor {
    display: grid;
    gap: 8px;
}

.status-options-list {
    display: grid;
    gap: 8px;
}

.status-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.status-option-row .status-option-input {
    width: 100%;
}

.status-option-add {
    justify-self: start;
}

.status-option-remove:disabled {
    opacity: 0.55;
    transform: none;
    cursor: not-allowed !important;
}

.settings-card .btn {
    height: 34px;
    min-width: 100px;
    padding: 0 13px;
    font-size: 12px;
}

.settings-card .settings-actions {
    gap: 8px;
}

.settings-summary {
    display: grid;
    gap: 10px;
}

.field-span-2,
.field-span-full {
    grid-column: 1 / -1;
}

.settings-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.setting-flag-card {
    display: grid;
    gap: 5px;
    min-height: 78px;
    padding: 10px 12px 9px;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    background: #fbfcfe;
    align-content: start;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #303133;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    user-select: none;
}

.checkbox-row input,
.checkbox-row input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin: 0;
    flex: 0 0 18px;
    align-self: center;
}

.setting-flag-card .field-help {
    margin-left: 28px;
    line-height: 1.45;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    outline: none;
    box-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 5px;
    width: 4px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) scale(0.85);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

input[type="checkbox"]:checked {
    border-color: var(--primary);
    background: var(--primary);
}

input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

input[type="checkbox"]:focus,
input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 1px rgba(64, 158, 255, 0.16);
}

input[type="checkbox"]:disabled {
    border-color: #dcdfe6;
    background: #f5f7fa;
}

input[type="checkbox"]:disabled::after {
    border-color: #c0c4cc;
}

.field-help {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.inline-form {
    display: inline-flex;
}

.table-note {
    color: var(--muted);
    font-size: 13px;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(64, 158, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #eef5ff 0%, #f6f9fd 48%, #eef3f9 100%);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(380px, 0.85fr);
    min-height: 100vh;
}

.login-visual {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #324157 0%, #25374c 100%);
}

.login-visual-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 24%),
        radial-gradient(circle at 80% 30%, rgba(64, 158, 255, 0.22), transparent 20%),
        radial-gradient(circle at 55% 75%, rgba(255, 255, 255, 0.06), transparent 22%);
}

.login-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    padding: 48px 54px;
    color: #ffffff;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-brand-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.login-brand-mark.brand-mark-plus::before {
    top: 9px;
    left: 20px;
    height: 20px;
}

.login-brand-mark.brand-mark-plus::after {
    top: 18px;
    left: 10px;
    width: 20px;
}

.login-brand strong {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.login-brand span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 15px;
}

.login-visual-copy {
    max-width: 520px;
}

.login-visual-copy h1 {
    margin: 0 0 18px;
    font-size: 40px;
    line-height: 1.2;
}

.login-visual-copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 16px;
    line-height: 1.9;
}

.login-visual-points {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.login-visual-points span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-card {
    width: min(460px, 100%);
    padding: 34px 34px 30px;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(31, 45, 61, 0.1);
}

.login-card .flash {
    margin: 0 0 18px;
}

.login-card-head {
    margin-bottom: 22px;
}

.login-card-head h2 {
    margin: 0 0 10px;
    color: var(--title);
    font-size: 28px;
}

.login-card-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.login-tip {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.install-shell {
    grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.1fr);
}

.install-panel {
    padding: 40px;
}

.install-card {
    width: min(760px, 100%);
    padding: 30px 32px 28px;
}

.install-card-head {
    margin-bottom: 18px;
}

.install-card-head p {
    line-height: 1.7;
}

.install-form {
    display: grid;
    gap: 18px;
}

.install-section {
    padding: 18px 18px 20px;
    border: 1px solid rgba(220, 223, 230, 0.86);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
}

.install-section h3 {
    margin: 0 0 14px;
    color: var(--title);
    font-size: 16px;
}

.install-form-grid {
    gap: 16px;
}

.install-form-grid .field {
    gap: 8px;
}

.install-form-grid .field input {
    min-height: 48px;
}

.install-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.install-visual-points {
    max-width: 520px;
}

@media (max-width: 1200px) {
    .settings-grid,
    .form-grid,
    .settings-toggle-grid {
        grid-template-columns: 1fr;
    }

    .settings-column {
        gap: 12px;
    }
}

@media (max-width: 1500px) {
    .query-panel {
        --query-control-height: 36px;
    }

    .query-panel .search-form {
        grid-template-columns:
            minmax(0, 1.12fr)
            minmax(0, 0.88fr)
            minmax(0, 0.88fr)
            minmax(0, 0.88fr)
            minmax(0, 1fr)
            minmax(0, 1fr)
            minmax(116px, 0.74fr);
        gap: 7px;
    }
}

@media (max-width: 1280px) {
    .query-panel {
        --query-label-height: 16px;
        --query-control-height: 34px;
    }

    .query-panel .search-form {
        grid-template-columns:
            minmax(0, 1.02fr)
            minmax(0, 0.82fr)
            minmax(0, 0.82fr)
            minmax(0, 0.82fr)
            minmax(0, 0.94fr)
            minmax(0, 0.94fr)
            minmax(108px, 0.7fr);
        gap: 6px;
    }

    .query-panel .field label,
    .query-panel .action-field-label {
        font-size: 10px;
    }

    .query-panel .query-control input,
    .query-panel .query-control select {
        padding: 0 10px;
        font-size: 11px;
    }

    .query-panel .query-control select {
        padding-right: 28px;
    }

    .query-panel .query-control-date input {
        padding-right: 31px;
    }

    .query-panel .search-actions .btn {
        padding: 0 8px;
        font-size: 10.5px;
    }
}

@media (max-width: 1080px) {
    .content-head,
    .table-header,
    .table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-head-meta {
        flex-wrap: wrap;
        align-items: center;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: 360px;
    }

    .install-panel {
        padding: 28px 18px 36px;
    }
}

@media (max-width: 960px) {
    .app-shell {
        height: auto;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .nav {
        flex: initial;
        overflow: visible;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-mask {
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(0, 0, 0, 0.28);
    }

    body.sidebar-open .sidebar-mask {
        display: block;
    }

    .main-shell {
        width: 100%;
        height: auto;
        margin-left: 0;
        display: block;
        overflow: visible;
    }

    .topbar {
        position: relative;
        top: auto;
    }

    .content {
        padding: 16px;
    }

    .search-form,
    .actions,
    .search-actions,
    .settings-actions {
        width: 100%;
    }

    .field.compact {
        min-width: min(100%, 220px);
        flex: 1 1 220px;
    }
}

@media (max-width: 767px) {
    .query-panel {
        overflow-x: visible;
    }

    .query-panel .search-form {
        width: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar {
        height: auto;
        padding: 14px 16px;
    }

    .topbar,
    .topbar-right {
        flex-wrap: wrap;
    }

    .page-path,
    .metric-note {
        display: none;
    }

    .content-head h1 {
        font-size: 20px;
    }

    .query-panel,
    .settings-card,
    .table-header,
    .table-footer,
    .modal-card,
    .login-panel,
    .install-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .login-visual-content {
        padding: 28px 24px;
    }

    .login-visual-copy h1 {
        font-size: 30px;
    }

    .company-chip {
        font-size: 13px;
    }

    .topbar-divider,
    .user-chip-name {
        display: none;
    }
}
