:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #595959;
  --line: #dedede;
  --rule: #bdbdbd;
  --wash: #f5f5f5;
  --status-abnormal: #a3262b;
  --status-warning: #805300;
  --status-normal: #17613b;
  --abnormal-wash: #fff4f4;
  --abnormal-hover: #ffe9e9;
  --type: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-family: var(--type);
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 0.22em; }
button { font: inherit; color: inherit; }
::selection { color: #fff; background: #282828; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
main:focus { outline: none; }

.shell {
  width: min(100% - clamp(36px, 8vw, 100px), 1120px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  inset: 10px auto auto 10px;
  z-index: 1;
  padding: 9px 12px;
  background: #fff;
  transform: translateY(calc(-100% - 20px));
}
.skip-link:focus { transform: none; }

.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.075rem;
  font-weight: 730;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 22px;
  height: 22px;
  flex: none;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 4px;
}
.brand-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.refresh-button {
  min-width: 76px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
}
.refresh-button:hover { background: var(--wash); }
.refresh-button[aria-busy="true"] { color: var(--muted); cursor: progress; }

.page { padding-block: clamp(26px, 5vw, 55px) 60px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 17px;
}
h1, h2, p { margin: 0; }
h1 {
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 720;
  line-height: 1.22;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.15rem;
  font-weight: 680;
  line-height: 1.4;
}
.updated, .muted, .detail-url { color: var(--muted); }
.updated, .reading { font-variant-numeric: tabular-nums; }
.updated { font-size: 0.82rem; line-height: 1.5; }
.count-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin: 0 0 19px;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  list-style: none;
  font-variant-numeric: tabular-nums;
}
.count-strip .total { color: var(--ink); padding-inline-end: 18px; border-inline-end: 1px solid var(--line); }
.count-strip [data-state] { color: var(--status-color, var(--muted)); }
.count-strip :is([data-state="abnormal"], [data-state="unknown"]) { font-weight: 700; }
.demo-label {
  display: inline-block;
  flex: none;
  padding: 3px 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 550;
  line-height: 1.3;
  letter-spacing: normal;
  vertical-align: middle;
}
.title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }

.notice {
  margin-block: 0 17px;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--wash);
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.notice p + p { margin-top: 3px; }
.message-panel {
  padding-block: 22px;
  border-block-start: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.message-panel strong { display: block; color: var(--ink); }

.data-table {
  width: 100%;
  border: 1px solid var(--line);
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  font-size: 0.875rem;
  line-height: 1.45;
}
.data-table th, .data-table td {
  padding: 13px 14px;
  text-align: start;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.data-table thead th {
  border-bottom: 1px solid var(--rule);
  background: var(--wash);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 640;
}
.data-table tbody tr + tr { border-top: 1px solid var(--line); }
.data-table tbody tr[data-state="abnormal"] { background: var(--abnormal-wash); }
.data-table tbody tr:is(:focus-within, :hover) { background: var(--row-hover, var(--wash)); }
.overview-table col:nth-child(1) { width: 22%; }
.overview-table col:nth-child(2) { width: 32%; }
.overview-table col:nth-child(3) { width: 14%; }
.overview-table col:nth-child(4) { width: 13%; }
.overview-table col:nth-child(5) { width: 19%; }
.site-name { font-weight: 670; }
.site-name:hover { text-decoration-thickness: 2px; }
.duration-abnormal { color: var(--status-abnormal); font-weight: 700; }
[data-state="abnormal"] {
  --status-color: var(--status-abnormal);
  --row-hover: var(--abnormal-hover);
}
[data-state="warning"] { --status-color: var(--status-warning); }
[data-state="normal"] { --status-color: var(--status-normal); }
.status-stack { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
.status-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--status-color, var(--muted));
  font-weight: 620;
  white-space: nowrap;
}
.status-label[data-state="abnormal"] { font-weight: 750; }
.status-label[data-state="normal"] { font-weight: 540; }
.status-mark {
  display: inline-grid;
  flex: none;
  width: 16px;
  height: 16px;
  place-items: center;
  font-size: 0.86rem;
  line-height: 1;
}
.status-label[data-state="abnormal"] .status-mark {
  border-radius: 3px;
  color: #fff;
  background: var(--status-abnormal);
  font-size: 0.76rem;
}
.status-label[data-state="unknown"] .status-mark {
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-size: 0.7rem;
}
.status-reason { color: var(--muted); }
.old-reading { display: block; margin-top: 4px; font-size: 0.8rem; }
.mobile-list { display: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 0.875rem;
}
.back-link::before {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(45deg);
}
.detail-url {
  display: inline-block;
  max-width: 100%;
  margin-top: 7px;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
.detail-heading { margin-bottom: 20px; }
.detail-status {
  margin-block: 0 23px;
  padding-block: 13px;
  border-block: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.5;
}
.key-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 10px 0 0;
  font-size: 0.85rem;
}
.key-values div { display: flex; flex-wrap: wrap; gap: 3px 6px; }
.key-values dt { color: var(--muted); }
.key-values dd { margin: 0; }
.detail-section + .detail-section { margin-top: 26px; }
.section-heading { margin-bottom: 9px; }
.section-meta { margin-block: 4px 9px; font-size: 0.82rem; }
.checks-table col:nth-child(1) { width: 22%; }
.checks-table col:nth-child(2) { width: 13%; }
.checks-table col:nth-child(3) { width: 28%; }
.checks-table col:nth-child(4) { width: 37%; }
.history-table col:nth-child(1) { width: 34%; }
.history-table col:nth-child(2), .history-table col:nth-child(3) { width: 25%; }
.history-table col:nth-child(4) { width: 16%; }

@media (max-width: 700px) {
  .masthead-inner { min-height: 57px; }
  .refresh-button { min-height: 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 6px; margin-bottom: 12px; }
  .count-strip { gap: 6px 11px; margin-bottom: 14px; }
  .count-strip .total { padding-inline-end: 11px; }
  .data-table { display: none; }
  .mobile-list { display: block; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
  .mobile-list > li { border-bottom: 1px solid var(--line); }
  .mobile-list > li[data-state="abnormal"] { background: var(--abnormal-wash); }
  .mobile-row {
    display: grid;
    gap: 5px;
    padding: 13px 7px;
    color: var(--ink);
    text-decoration: none;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .mobile-row:is(:hover, :focus-visible) { background: var(--row-hover, var(--wash)); }
  .mobile-row:focus-visible { outline-offset: -2px; }
  .mobile-row-title { display: flex; align-items: baseline; gap: 9px; }
  .mobile-row-title .site-name { min-width: 0; margin-right: auto; }
  .mobile-row-title::after {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    margin: 0 3px;
    border: solid var(--muted);
    border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg);
  }
  .mobile-reason, .mobile-meta { font-size: 0.82rem; }
  .mobile-meta { display: flex; flex-wrap: wrap; gap: 3px 13px; }
  .mobile-record { padding: 11px 4px; font-size: 0.875rem; line-height: 1.5; overflow-wrap: anywhere; }
  .mobile-record .key-values { display: grid; gap: 4px; margin-top: 5px; }
  .detail-heading { margin-bottom: 16px; }
  .detail-status { margin-bottom: 20px; }
}
