:root {
    color-scheme: light;
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: #172033;
    background: #eef3f8;
    --ink: #172033;
    --muted: #697789;
    --line: #d9e2ee;
    --line-strong: #c3cfdf;
    --panel: #ffffff;
    --soft: #f7f9fc;
    --brand: #1f5c99;
    --brand-dark: #174671;
    --shadow: 0 18px 48px rgba(31, 49, 74, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

[hidden] {
    display: none !important;
}

button,
input {
    font: inherit;
}

button {
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

button:hover {
    border-color: var(--brand);
    box-shadow: 0 6px 18px rgba(31, 92, 153, .12);
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

button.primary:hover {
    background: var(--brand-dark);
}

input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    outline: 0;
    transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 92, 153, .12);
}

label {
    display: grid;
    gap: 6px;
    color: #4a596d;
    font-size: 13px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(22, 38, 61, .95), rgba(31, 92, 153, .86)),
        linear-gradient(180deg, #eef3f8, #dde7f2);
}

.login-panel {
    width: min(440px, 100%);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 30px 90px rgba(10, 22, 38, .28);
}

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

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #16263d;
    color: #eaf3ff;
    font-weight: 700;
    letter-spacing: 0;
}

.login-brand h1,
.topbar h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 650;
}

.login-brand p,
.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

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

.login-form button {
    margin-top: 4px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 32px;
    background: #16263d;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.topbar .brand-mark {
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
}

.topbar p {
    color: #c9d6e6;
}

.session {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d7e2ef;
}

.session span {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-main {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 24px 32px 40px;
}

.workbench,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.workbench {
    margin-bottom: 18px;
    padding: 16px;
}

.search {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    gap: 12px;
    align-items: end;
}

.panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.panel-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
}

.panel-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.pager {
    display: flex;
    gap: 8px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 18px;
    border-bottom: 1px solid #e9eef5;
    text-align: left;
    vertical-align: top;
}

th {
    position: sticky;
    top: 0;
    background: #f4f7fb;
    color: #3e4c60;
    font-size: 13px;
    font-weight: 650;
}

tbody tr:hover {
    background: #f8fbff;
}

.link-button {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 650;
    text-align: left;
}

.link-button:hover {
    background: transparent;
    box-shadow: none;
    text-decoration: underline;
}

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

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

.empty {
    padding: 34px 18px;
    text-align: center;
}

dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 28px 80px rgba(13, 26, 46, .3);
}

dialog::backdrop {
    background: rgba(15, 23, 42, .45);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.dialog-head h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
}

.dialog-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
}

.detail-body {
    max-height: calc(100vh - 150px);
    overflow: auto;
    padding: 20px 22px 24px;
}

.detail-section + .detail-section {
    margin-top: 22px;
}

.detail-section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #2f3d51;
}

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

.info-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--soft);
}

.info-grid .wide {
    grid-column: span 2;
}

.info-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.info-grid strong {
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 12px;
}

.event-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.event-table {
    min-width: 980px;
}

.event-table th {
    position: static;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(31, 92, 153, .13);
}

.timeline-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.timeline-main strong {
    color: var(--ink);
}

.timeline-main span,
.timeline-meta {
    color: var(--muted);
}

.timeline-meta {
    margin-top: 4px;
    font-size: 13px;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: min(420px, calc(100vw - 40px));
    padding: 12px 14px;
    border-radius: 8px;
    color: #fff;
    background: #1d2939;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .2);
}

@media (max-width: 760px) {
    .topbar,
    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .search,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-grid .wide {
        grid-column: auto;
    }

    .session,
    .pager {
        flex-wrap: wrap;
    }

    .page-main,
    .topbar {
        padding-left: 16px;
        padding-right: 16px;
    }
}
