:root {
    color-scheme: dark;
    --shell: #101512;
    --surface: #18211b;
    --control: #111914;
    --line: #354239;
    --text: #edf2e9;
    --muted: #a6b3a7;
    --accent: #c5f28e;
    --negative: #ffb8a8;
    font: 14px/1.55 "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--shell); }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .secondary, .primary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:is(a, button, input, select, textarea, [tabindex="0"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, select, textarea { display: block; width: 100%; min-width: 0; border: 1px solid #536358; border-radius: 8px; background: var(--control); color: var(--text); padding: 9px 11px; min-height: 39px; }
input::placeholder, textarea::placeholder { color: #96a298; }
label { display: grid; gap: 5px; color: var(--text); font-weight: 620; }
label small { color: var(--muted); font-weight: 400; }
textarea { resize: vertical; font: 13px/1.65 Consolas, monospace; }
.primary, .secondary, .quiet, .danger { display: inline-flex; justify-content: center; align-items: center; min-height: 37px; padding: 6px 12px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); white-space: nowrap; }
.primary { color: #152312; background: var(--accent); font-weight: 730; }
.primary:hover:enabled, a.primary:hover { background: #dcffb4; }
.secondary { border-color: #506055; background: #222e25; }
.secondary:hover:enabled, a.secondary:hover { background: #2d3b31; }
.quiet { color: var(--muted); }
.quiet:hover:enabled { background: #29362d; color: var(--text); }
.danger { color: var(--negative); border-color: #7d4d43; background: #382622; }
.danger:hover:enabled { background: #4d2f29; }
.text-link { color: var(--accent); white-space: nowrap; }
.text-link:hover, .site-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 50% 12%, #223321, var(--shell) 58%); }
.login-card { width: min(100%, 425px); padding: clamp(22px, 5vw, 35px); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.login-card h1 { margin: 23px 0 18px; font-size: 26px; }
.login-card form { display: grid; gap: 15px; }
.login-card .primary { margin-top: 5px; }
.login-card .text-link { display: inline-block; margin-top: 13px; }
.message { color: var(--negative); overflow-wrap: anywhere; }
.message:not(:empty) { margin-top: 10px; }

.console { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 27px; padding: 21px 14px 18px; border-right: 1px solid var(--line); background: #151e18; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; white-space: nowrap; font-size: 18px; }
.brand-mark { display: grid; place-items: center; width: 33px; height: 33px; flex: none; border-radius: 9px; background: var(--accent); color: #182717; font-size: 14px; }
.sidebar .brand { margin: 0 7px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .site-link { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.sidebar nav a span { width: 19px; text-align: center; font-size: 17px; font-family: system-ui, sans-serif; }
.sidebar nav a:hover { color: var(--text); background: #24322a; }
.sidebar nav a[aria-current="page"] { color: var(--accent); background: #26372a; border-color: #496147; font-weight: 690; }
.site-link { margin-top: auto; }
.topbar { min-height: 70px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 10px clamp(16px, 3vw, 38px); border-bottom: 1px solid var(--line); background: #141d17; }
.breadcrumb { color: var(--muted); }
.breadcrumb span { padding: 0 7px; }
.breadcrumb strong { color: var(--text); }
.account { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #354a34; color: var(--accent); font-weight: 750; }
.content { max-width: 1510px; margin-inline: auto; padding: clamp(18px, 3vw, 38px); }
.page-heading, .panel-heading, .dialog-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.page-heading { margin-bottom: 23px; }
.page-heading h1 { font-size: clamp(25px, 3vw, 35px); line-height: 1.2; }
.page-heading p, .panel-heading p, .dialog-header p { color: var(--muted); margin-top: 5px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.panel-heading { padding: 18px 19px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .dialog-header h2 { font-size: 18px; }
.notice { padding: 9px 13px; margin-bottom: 14px; border-radius: 8px; border: 1px solid #526849; background: #243524; color: #daedce; }
.notice.error { background: #392621; color: var(--negative); border-color: #7d4d43; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.metric { display: grid; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); padding: clamp(11px, 2vw, 18px); }
.metric:hover { background: #223128; border-color: #526849; }
.metric strong { color: var(--text); font: 680 clamp(23px, 3vw, 35px)/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric[data-filter="active"] strong { color: var(--accent); }
.activity { margin: 0; padding: 0 19px; list-style: none; }
.activity li { padding: 12px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px 12px; }
.activity li + li { border-top: 1px solid var(--line); }
.activity li > div { display: grid; min-width: 0; gap: 3px; }
.activity time, .muted { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.filters .search { flex: 1 1 210px; }
.filters select { min-width: 120px; }
.batch-filter { padding: 5px 17px; background: #233128; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; overflow-wrap: anywhere; }
.table-scroll { overflow: auto; }
.table-scroll:focus-visible { outline-offset: -3px; }
table { width: 100%; text-align: left; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 680; background: #1c2820; white-space: nowrap; }
td { min-width: 85px; }
td:nth-child(1) { min-width: 135px; }
td:last-child { white-space: nowrap; }
td time { white-space: nowrap; }
td button { min-height: 32px; }
tbody tr:hover { background: #1d2921; }
.record { display: grid; gap: 3px; overflow-wrap: anywhere; }
.record strong, .mono { font: 13px/1.5 Consolas, monospace; }
.record small { color: var(--muted); }
.state { display: inline-block; padding: 2px 8px; border: 1px solid #536358; border-radius: 6px; color: #c2cfc2; background: #233028; white-space: nowrap; font-size: 12px; }
.state.active { background: #283d26; border-color: #516f45; color: #cfedaf; }
.state.expired { background: #372f20; border-color: #6d5934; color: #ecd39f; }
.state.revoked { background: #392721; border-color: #774940; color: var(--negative); }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 14px; }
.pagination span { color: var(--muted); margin-right: auto; }
.pagination button { font-size: 12px; padding-inline: 9px; min-height: 31px; }
.details { display: grid; grid-template-columns: minmax(105px, auto) minmax(0, 1fr); gap: 11px 14px; overflow-wrap: anywhere; }
.details dt { color: var(--muted); }
.release .details { padding: 18px 19px; }
.details:empty { display: none; }

dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100% - 28px); overflow: auto; padding: 0; border: 1px solid #536358; border-radius: 15px; color: var(--text); background: var(--surface); }
dialog::backdrop { background: #070b08c9; }
.dialog-header { align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.close { width: 37px; padding: 0; font-size: 22px; }
.dialog-content { display: grid; gap: 13px; padding: 17px 18px 19px; }
.dialog-actions { justify-content: flex-end; }
.hint { color: var(--muted); }
.confirm { display: grid; gap: 9px; padding: 11px; border-radius: 8px; border: 1px solid #7d4d43; background: #382622; }
.confirm .actions { justify-content: flex-end; }

@media (max-width: 1050px) {
    .console { grid-template-columns: 176px minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .console { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; display: grid; gap: 10px; padding: 11px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .brand { margin: 0; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .sidebar nav a { gap: 4px; min-height: 33px; padding: 3px 6px; font-size: 12px; }
    .sidebar nav a span { width: 16px; font-size: 14px; }
    .site-link { display: none; }
    .topbar { min-height: 49px; }
    .content { padding-inline: 13px; }
}
@media (max-width: 400px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .breadcrumb span, .breadcrumb strong { display: none; }
}
