
:root {
    --bg: #f4f7ff;
    --panel: #f1f5f9;
    --card: #ffffff;
    --border: #d7dde8;
    --text: #0f172a;
    --muted: #475569;
    --danger: #dc2626;
    --ok: #16a34a;
    --warn: #d97706;
    --accent: #2563eb;
    --fs: 14px;
    --fsS: 12px;
    --fsL: 16px;
    --r: 14px;
    --pad: 14px;
    --shadow: 0 12px 30px rgba(15,23,42,.14);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
    font-size: var(--fs);
    line-height: 1.35;
    min-width: 1200px; /* fixed desktop feel */
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Layout */
.shell {
    width: 100%;
    height: 100%;
    margin: 0; /* 关键：去掉会撑高页面的 margin */
    min-height: 0;
    border: 1px solid rgba(15,23,42,.07);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: rgba(255,255,255,.72);
    display: flex;
}

.sidebar {
    width: 260px;
    background: rgba(255,255,255,.75);
    border-right: 1px solid rgba(15,23,42,.07);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 18px;
    background: rgba(15,23,42,.04);
}

    .brand .left {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .brand .title {
        font-size: 20px;
        font-weight: 850;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .brand .sub {
        font-size: 14px;
        color: var(--muted);
        margin-top: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .brand .brandUser {
        color: rgba(15,23,42,.92);
        font-weight: 750;
    }

    .brand .badge {
        width: 44px;
        height: 44px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(37,99,235,.12);
        border: 1px solid rgba(37,99,235,.22);
    }

        .brand .badge i {
            font-size: 18px;
        }

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.navbtn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.08);
    background: rgba(15,23,42,.04);
    color: rgba(15,23,42,.85);
    cursor: pointer;
    font-weight: 650;
    text-align: left;
}

    .navbtn i {
        width: 18px;
        text-align: center;
    }

    .navbtn.active {
        background: rgba(37,99,235,.14);
        border-color: rgba(37,99,235,.25);
        color: var(--text);
    }

    .navbtn:active {
        transform: translateY(1px);
    }

.sidebarfooter {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.iconbtn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(15,23,42,.05);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .iconbtn:active {
        transform: translateY(1px);
    }

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.topbar {
    height: 58px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15,23,42,.07);
    background: rgba(255,255,255,.65);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .topbar .left {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .topbar .h1 {
        font-size: 16px;
        font-weight: 750;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 720px;
    }

    .topbar .h2 {
        font-size: 12px;
        color: var(--muted);
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 720px;
    }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(15,23,42,.04);
    font-size: 12px;
    color: rgba(15,23,42,.92);
    white-space: nowrap;
}

    .pill.ok {
        border-color: rgba(22,163,74,.45);
    }

    .pill.warn {
        border-color: rgba(217,119,6,.45);
    }

    .pill.danger {
        border-color: rgba(220,38,38,.45);
    }

.content {
    flex: 1;
    overflow: auto;
    padding: 14px 16px 18px;
}

    .content::-webkit-scrollbar {
        width: 10px;
    }

    .content::-webkit-scrollbar-thumb {
        background: rgba(15,23,42,.18);
        border-radius: 999px;
    }

/* Cards, tables, form */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.card {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(15,23,42,.08);
    border-radius: var(--r);
    padding: 12px;
}

    .card .label {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 6px;
    }

    .card .value {
        font-size: 18px;
        font-weight: 800;
        letter-spacing: .2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

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

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

input, select, textarea {
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.80);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

textarea {
    min-height: 90px;
    resize: vertical;
    width: 100%;
}

.btn {
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(37,99,235,.18);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}

    .btn.secondary {
        background: rgba(15,23,42,.05);
        border-color: rgba(15,23,42,.10);
    }

    .btn.danger {
        background: rgba(220,38,38,.14);
        border-color: rgba(220,38,38,.35);
    }

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

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.92);
}

th, td {
    padding: 10px 10px;
    font-size: 13px;
    border-bottom: 1px solid rgba(15,23,42,.06);
    vertical-align: top;
}

th {
    text-align: left;
    color: rgba(15,23,42,.92);
    font-weight: 750;
    background: rgba(15,23,42,.04);
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:last-child td {
    border-bottom: none;
}

td .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(15,23,42,.04);
    font-size: 12px;
    color: rgba(15,23,42,.92);
    margin-right: 6px;
    margin-top: 4px;
}

.chip.ok {
    border-color: rgba(22,163,74,.35);
}

.chip.warn {
    border-color: rgba(217,119,6,.35);
}

.chip.danger {
    border-color: rgba(220,38,38,.35);
}

.sectionTitle {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 10px;
}

.sectionSub {
    font-size: 12px;
    color: var(--muted);
    margin: -6px 0 12px;
}

/* Login view */
.loginWrap {
    width: 100%;
    height: 100%;
    margin: 18px auto;
    border: 1px solid rgba(15,23,42,.07);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    background: rgba(255,255,255,.80);
}

.loginLeft {
    flex: 1.1;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(15,23,42,.06));
    border-right: 1px solid rgba(15,23,42,.07);
}

    .loginLeft h1 {
        margin: 0;
        font-size: 22px;
        font-weight: 850;
        letter-spacing: .2px;
    }

    .loginLeft p {
        margin: 0;
        color: var(--muted);
        max-width: 520px;
        font-size: 13px;
    }

.loginRight {
    flex: 0.9;
    padding: 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.loginCard {
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.08);
    background: rgba(255,255,255,.92);
    padding: 16px;
}

.field {
    margin-bottom: 10px;
}

    .field .label {
        font-size: 12px;
        color: var(--muted);
        margin-bottom: 6px;
    }

.loginActions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* Modal */
.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

    .modalOverlay.show {
        display: flex;
        z-index: 1;
    }

.modal {
    width: 860px;
    max-width: 95vw;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modalHeader {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(15,23,42,.08);
    background: rgba(15,23,42,.03);
}

    .modalHeader .title {
        font-weight: 800;
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 640px;
    }

.modalBody {
    padding: 14px;
}

.modalFooter {
    padding: 12px 14px;
    border-top: 1px solid rgba(15,23,42,.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: rgba(15,23,42,.03);
}

.twoCol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.full {
    grid-column: 1 / -1;
}

.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(37,99,235,.25);
    background: rgba(37,99,235,.10);
    margin-top: 10px;
}

    .notice i {
        margin-top: 2px;
    }

.dangerNote {
    border-color: rgba(220,38,38,.30);
    background: rgba(220,38,38,.10);
}
/* -----------------------------
      UI/UX Enhancements (v2)
      - Info icon notes with expand/collapse
      - Filter panels for tables
      - Exception resolution controls
      - Custom interval input (value + unit + presets)
      - Toast notifications
      - Modal focus handling
    ----------------------------- */
.srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
    white-space: nowrap;
}

.noteWrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.noteIcon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(37,99,235,.28);
    background: rgba(37,99,235,.12);
    color: rgba(37,99,235,.92);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
    flex: 0 0 auto;
}

    .noteIcon:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 18px rgba(2,6,23,.10);
    }

    .noteIcon.warn {
        border-color: rgba(220,38,38,.30);
        background: rgba(220,38,38,.10);
        color: rgba(220,38,38,.92);
    }

.notePanel {
    flex: 1;
    border-radius: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(37,99,235,.22);
    background: rgba(37,99,235,.06);
}

    .notePanel.warn {
        border-color: rgba(220,38,38,.20);
        background: rgba(220,38,38,.06);
    }

.noteTitle {
    font-weight: 800;
}

.notePanel .small {
    line-height: 1.45;
}

.searchWrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(15,23,42,.14);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 18px rgba(2,6,23,.06);
}

    .searchWrap i {
        color: rgba(15,23,42,.55);
    }

    .searchWrap input {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 10px 4px !important;
        width: 100% !important;
        margin: 0 !important;
    }

        .searchWrap input:focus {
            outline: none;
        }

.iconOnly {
    width: 42px;
    padding: 0;
    display: grid;
    place-items: center;
    height: 38px;
}

.filterPanel {
    margin-top: 12px;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.10);
    background: rgba(255,255,255,.86);
    box-shadow: 0 20px 34px rgba(2,6,23,.10);
    padding: 12px;
}

.filterHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.filterTitle {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filterGrid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 12px;
}

@media (max-width:1200px) {
    .filterGrid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

.filterFooter {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.filterChips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.filterChip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.14);
    background: rgba(15,23,42,.04);
    font-size: 12px;
    color: rgba(15,23,42,.90);
}

    .filterChip button {
        border: none;
        background: transparent;
        cursor: pointer;
        color: rgba(15,23,42,.55);
    }

        .filterChip button:hover {
            color: rgba(15,23,42,.92);
        }

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

.intervalInput {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(15,23,42,.14);
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 18px rgba(2,6,23,.06);
}

    .intervalInput input {
        width: 120px;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid rgba(15,23,42,.14);
        background: rgba(255,255,255,.98);
    }

    .intervalInput select {
        width: 160px;
    }

.inlineError {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(220,38,38,.30);
    background: rgba(220,38,38,.10);
    color: rgba(220,38,38,.92);
    font-size: 12px;
    line-height: 1.35;
}

.resolutionWrap {
    display: grid;
    gap: 10px;
}

.radioCard {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-radius: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.90);
    cursor: pointer;
    transition: box-shadow .12s ease, transform .12s ease;
}

    .radioCard:hover {
        transform: translateY(-1px);
        box-shadow: 0 16px 26px rgba(2,6,23,.10);
    }

    .radioCard input {
        margin-top: 4px;
        accent-color: var(--accent);
    }

.radioTitle {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resolutionSub {
    margin-top: 10px;
    border-radius: 16px;
    padding: 12px;
    border: 1px dashed rgba(15,23,42,.18);
    background: rgba(15,23,42,.03);
}

body.modalOpen {
    overflow: hidden;
}

.toastHost {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60;
    max-width: 360px;
}

.toast {
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,.12);
    background: rgba(255,255,255,.94);
    box-shadow: 0 20px 34px rgba(2,6,23,.18);
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: toastIn .16s ease-out;
}

    .toast .toastTitle {
        font-weight: 900;
    }

    .toast .toastBody {
        font-size: 12px;
        color: rgba(15,23,42,.72);
        margin-top: 4px;
    }

@keyframes toastIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hiddentext {
    visibility: hidden; /* 只隐藏，仍占位 */
}
