:root {
  color-scheme: light;
  --canvas: #f2f5fa;
  --text: #14213a;
  --muted: #4b5c75;
  --navy: #101d37;
  --primary: #204bc4;
  --border: #cad4e3;
  --white: #fff;
  font: 16px/1.5 system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; border-radius: 8px; padding: 0 15px; min-height: 44px; font-weight: 650; }
button:disabled { cursor: wait; opacity: .62; }
:focus-visible { outline: 3px solid #4672ef; outline-offset: 3px; }
p { margin: 6px 0 0; color: var(--muted); }
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -.03em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.45rem; }
.wrap { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }
.site-header { color: var(--white); background: var(--navy); }
.header-inner, .brand, .page-heading, .actions, .toolbar { display: flex; align-items: center; gap: 12px; }
.header-inner { min-height: 70px; justify-content: space-between; }
.brand { font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; background: #315ce0; border-radius: 9px; width: 34px; height: 34px; }
.header-button { background: transparent; color: var(--white); border: 1px solid #64769a; }
main { padding-block: clamp(24px, 5vw, 52px); }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 2px 6px #14213a08; }
.sign-in { max-width: 460px; margin: 24px auto; padding: clamp(22px, 6vw, 40px); }
.sign-in h1 { font-size: 1.8rem; }
.sign-in p { margin-block: 12px; }
.sign-in form { display: grid; gap: 8px; margin-top: 22px; }
.sign-in label:not(:first-child) { margin-top: 6px; }
.sign-in button { margin-top: 10px; width: 100%; }
.sign-in p:empty, .form-message:empty { display: none; }
.page-heading { justify-content: space-between; align-items: end; margin-bottom: 20px; }
.primary { background: var(--primary); color: var(--white); border: 1px solid var(--primary); }
.primary:hover:not(:disabled) { background: #163aa7; }
.secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.secondary:hover:not(:disabled) { background: #eaf0ff; }
.danger { background: #a02231; color: white; border: 1px solid #a02231; }
.danger:hover:not(:disabled) { background: #771523; }
.toolbar { padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search { flex: 1; min-width: min(100%, 240px); }
input:not([type='checkbox']), select { width: 100%; min-height: 44px; color: var(--text); border: 1px solid #a9b7cc; border-radius: 8px; padding: 8px 11px; background: var(--white); }
input::placeholder { color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0 16px; }
.rows li { display: grid; grid-template-columns: minmax(8rem, 1.2fr) minmax(6rem, .7fr) minmax(5rem, .6fr) minmax(8rem, 1.1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #dce4ef; }
.rows li:last-child { border-bottom: 0; }
.row-field { display: grid; min-width: 0; overflow-wrap: anywhere; }
.row-field small { color: var(--muted); font-size: .82rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.badge { justify-self: start; padding: 3px 9px; border-radius: 30px; white-space: nowrap; font-size: .85rem; font-weight: 650; }
.active { color: #155942; background: #dff5e9; }
.expired { color: #664406; background: #f9edcd; }
.revoked { color: #8b2838; background: #f8e5e9; }
.empty { text-align: center; padding: 38px 16px; }
#notice { margin: 0 0 12px; padding: 10px 14px; background: #e6ecfb; border-radius: 8px; color: var(--text); }
dialog { width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: clamp(18px, 5vw, 28px); border: 1px solid var(--border); border-radius: 14px; color: var(--text); }
dialog::backdrop { background: #101d3780; }
dialog label { display: grid; gap: 5px; }
dialog .actions { justify-content: end; margin-top: 16px; }
dialog p, #issued-key, #revoke-form label { margin-top: 12px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.wide { grid-column: 1 / -1; }
dialog .check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 19px; height: 19px; }
.form-message { color: #8b2838; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 640px) {
  .page-heading { align-items: start; flex-direction: column; }
  .toolbar .search { flex-basis: 100%; }
  .rows li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
  .badge { grid-column: 1 / -1; }
}
