:root {
    color-scheme: light;
    --paper: #ffffff;
    --background: #f4f6f9;
    --ink: #172439;
    --muted: #526277;
    --line: #d9e0e9;
    --primary: #214f96;
    --primary-hover: #19437f;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 15px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--background);
    line-height: 1.5;
}

h1, p {
    margin: 0;
}

h1 {
    font-size: clamp(1.55rem, 3vw, 2rem);
    letter-spacing: .015em;
}

a {
    color: var(--primary);
}

:focus-visible {
    outline: 2px solid #385ba6;
    outline-offset: 3px;
}

.shell {
    width: min(76rem, 100% - 3rem);
    margin: 0 auto;
}

.masthead {
    background: #172439;
    color: #ffffff;
}

.masthead-inner {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: .08em;
}

.logout {
    min-height: 2.25rem;
    padding: 0 .8rem;
    border: 1px solid #8597b1;
    border-radius: .45rem;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
}

.logout:hover {
    background: #30415d;
}

.logout:focus-visible {
    outline-color: #ffffff;
}

main {
    padding: 2.25rem 0 3rem;
}

.panel {
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: var(--paper);
}

.login-panel {
    width: min(27rem, 100%);
    margin: clamp(.5rem, 9vh, 5rem) auto 0;
    padding: clamp(1.25rem, 5vw, 2.35rem);
    box-shadow: 0 8px 26px #1724390a;
}

.login-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
}

.login-form .button {
    margin-top: .25rem;
}

.form-error {
    margin-top: .85rem;
    padding: .65rem .8rem;
    border-radius: .45rem;
    background: #fff0ee;
    color: #922e28;
}

.page-heading {
    margin-bottom: 1.35rem;
}

.page-heading p {
    margin-top: .4rem;
    color: var(--muted);
}

.search-panel {
    padding: 1.1rem;
    margin-bottom: 1.2rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: end;
    gap: .85rem;
}

.field {
    display: grid;
    min-width: 0;
    gap: .35rem;
    font-weight: 600;
}

.field input,
.field select {
    width: 100%;
    min-width: 0;
    min-height: 2.7rem;
    padding: .45rem .65rem;
    border: 1px solid #aebbd0;
    border-radius: .45rem;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

.filter-actions, .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.button {
    display: inline-flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: center;
    padding: .45rem .85rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--primary-hover);
}

.button-secondary {
    border-color: #aebbd0;
    background: var(--paper);
    color: var(--ink);
}

.button-secondary:hover {
    background: #edf2f8;
}

.results {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: .8rem .85rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: #edf2f8;
    font-weight: 650;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f8fafc;
}

.identifier {
    width: 17%;
    min-width: 8rem;
    overflow-wrap: anywhere;
    font-family: ui-monospace, Consolas, "Microsoft YaHei", monospace;
    font-size: .86rem;
    line-height: 1.45;
}

.time, .version {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    padding: .2rem .55rem;
    border-radius: .35rem;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-recent {
    color: #185a43;
    background: #e7f4eb;
}

.status-expired {
    color: #8a4910;
    background: #fff1db;
}

.empty-state {
    padding: 3rem 1rem;
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    padding: .85rem;
    color: var(--muted);
}

.pagination .button {
    min-height: 2.25rem;
}

.skip-link {
    position: absolute;
    z-index: 1;
    top: .5rem;
    left: .5rem;
    background: #ffffff;
    padding: .45rem .65rem;
    transform: translateY(-140%);
}

.skip-link:focus {
    transform: translateY(0);
}

@media (max-width: 60rem) {
    .filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 35rem) {
    .shell {
        width: calc(100% - 1.5rem);
    }

    main {
        padding-top: 1.5rem;
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    th, td {
        padding: .65rem;
    }
}
