:root {
  color-scheme: light;
  accent-color: var(--accent);
  font:
    15px/1.5 'PingFang SC',
    'Microsoft YaHei',
    Inter,
    sans-serif;
  color: #252326;
  background: #fbfaf9;
  --ink: #252326;
  --accent: #b82036;
  --line: #dedbd9;
  --muted: #675f60;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body,
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.045em;
  line-height: 1.3;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.02em;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: white;
  border: 1px solid #c9c3c1;
  border-radius: 5px;
  padding: 7px 13px;
  font-size: 13px;
}
button:hover {
  background: #f9edeb;
}
button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
button.primary:hover {
  background: #971b2e;
  border-color: #971b2e;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #b82036;
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.5;
}
button.danger {
  color: #790d25;
  border-color: #bb8c96;
}
.signature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
}
.signature i {
  display: inline-block;
  border: 2px solid #fff3f1;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  position: relative;
  background: #911b2e;
}
.signature i:after {
  content: '';
  position: absolute;
  left: 4px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  border-left: 2px solid #fff3f1;
  border-right: 2px solid #fff3f1;
  transform: skewY(-15deg);
}
.signature span {
  font-size: 12px;
  color: #ffe9e5;
  font-weight: 450;
  border-left: 1px solid #c97786;
  padding-left: 10px;
}
header {
  height: 60px;
  background: #911b2e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
#viewer {
  min-width: 0;
  margin: 0 12px 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
#managerFilter select {max-width: min(100%, 32ch)}
header button {
  color: #fff4f1;
  border-color: #d08b93;
  background: transparent;
}
header button:hover {
  background: #741426;
}
.layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}
nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f7f5f4;
  border-right: 1px solid var(--line);
  padding: 22px 13px;
}
#tabs {
  display: grid;
  gap: 5px;
}
nav button {
  border: 0;
  text-align: left;
  color: #5e5658;
  background: transparent;
}
nav button[aria-current='true'] {
  background: #f6dfdf;
  color: #951b30;
  font-weight: 650;
}
main {
  width: 100%;
  max-width: 1550px;
  padding: 35px clamp(19px, 3.8vw, 65px);
}
.heading,
.sectionTitle,
.filters,
.modalhead {
  display: flex;
  align-items: center;
  gap: 12px;
}
.heading,
.sectionTitle,
.modalhead {
  justify-content: space-between;
}
.heading {
  margin-bottom: 26px;
}
.sectionTitle {
  margin: 24px 0 13px;
}
.sectionTitle p,
.sectionTitle small,
.filters span,
.muted {
  color: var(--muted);
  font-size: 13px;
}
.filters {
  flex-wrap: wrap;
  align-items: end;
}
.filters span {
  padding: 8px 0;
}
label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 550;
}
input,
textarea,
select {
  background: #fff;
  border: 1px solid #c9c3c1;
  border-radius: 5px;
  padding: 8px 10px;
  min-width: 0;
}
textarea {
  min-height: 120px;
  font:
    13px/1.4 ui-monospace,
    monospace;
  width: 100%;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 25px 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.metrics > div {
  padding: 20px;
  min-width: 0;
}
.metrics > div + div {
  border-left: 1px solid var(--line);
}
.metrics span,
.metrics small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.metrics strong {
  display: block;
  font:
    600 clamp(17px, 2.4vw, 30px) / 1.5 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.scroll {
  max-width: 100%;
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
td,
th {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  white-space: nowrap;
  color: #5e5658;
  background: #f5f3f2;
  font-weight: 550;
}
tr:last-child td {
  border: 0;
}
td button {
  margin: 2px;
  font-size: 12px;
  padding: 4px 7px;
}
.num {
  font-variant-numeric: tabular-nums;
}
.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
.badge {
  white-space: nowrap;
  color: #484146;
  background: #ece9e7;
  border-radius: 3px;
  padding: 2px 6px;
}
.off {
  color: #72132a;
  background: #fbe6e8;
}
.event {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
code,
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    13px/1.6 ui-monospace,
    monospace;
}
dialog {
  width: min(560px, 94vw);
  max-height: 90vh;
  padding: 22px;
  border: 1px solid #c9c3c1;
  border-radius: 8px;
  color: inherit;
}
dialog::backdrop {
  background: #281a2080;
}
dialog form,
#gate form {
  display: grid;
  gap: 15px;
}
.modalhead {
  margin-bottom: 18px;
}
.modalhead button {
  border: 0;
  color: var(--muted);
}
#formError,
#loginError {
  color: #790d25;
  font-size: 13px;
  margin-top: 8px;
}
dialog pre {
  background: #f6f3f2;
  padding: 12px;
}
#gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f8f6f5;
}
#gate form {
  width: min(390px, 90vw);
  background: #fff;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
#gate h1 {
  font-size: 27px;
}
#gate .signature {
  color: #712b37;
  font-size: 14px;
}
#toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #30272a;
  color: white;
  font-size: 13px;
  padding: 10px 15px;
  border-radius: 5px;
}
#events p {
  color: var(--muted);
}
@media (max-width: 760px) {
  header {
    padding: 0 14px;
  }
  .layout {
    display: block;
  }
  nav {
    padding: 7px;
    flex-direction: row;
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    overflow: auto;
  }
  #tabs {
    display: flex;
  }
  nav button {
    white-space: nowrap;
    padding: 7px;
    font-size: 12px;
  }
  #adminChange {
    font-size: 11px;
  }
  main {
    padding: 20px 13px;
  }
  .filters {
    gap: 7px;
  }
  .metrics > div {
    padding: 10px 7px;
  }
  td,
  th {
    padding: 9px 7px;
  }
  .sectionTitle {
    flex-wrap: wrap;
  }
  .sectionTitle small {
    font-size: 11px;
  }
}
