:root {
  --bg: #f6f8fa;
  --panel: #ffffff;
  --text: #0f1720;
  --muted: #5b6875;
  --line: #e3e8ee;
  --ok: #1f9d62;
  --ok-soft: #e7f6ee;
  --minor: #e0a21b;
  --major: #d9483b;
  --major-soft: #fdecea;
  --maint: #3b6fd9;
  --maint-soft: #e9f0fd;
  --none: #d4dbe2;
  --accent: #0b8a96;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1118;
    --panel: #121a23;
    --text: #e6edf3;
    --muted: #93a1af;
    --line: #223040;
    --ok: #2fbf7a;
    --ok-soft: #12291f;
    --minor: #e6b13c;
    --major: #ef6b5f;
    --major-soft: #2f1716;
    --maint: #6b95ef;
    --maint-soft: #15213a;
    --none: #2a3846;
    --accent: #2bb3bf;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1118; --panel: #121a23; --text: #e6edf3; --muted: #93a1af; --line: #223040;
  --ok: #2fbf7a; --ok-soft: #12291f; --minor: #e6b13c; --major: #ef6b5f; --major-soft: #2f1716;
  --maint: #6b95ef; --maint-soft: #15213a; --none: #2a3846; --accent: #2bb3bf; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "IBM Plex Sans", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* header */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--text); flex: none; }
.brand b { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.top-nav a { color: var(--muted); }
.top-nav .btn { color: #fff; background: var(--accent); padding: 7px 12px; border-radius: 8px; }
.top-nav .btn:hover { text-decoration: none; opacity: .92; }
.lang { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }

/* overall */
.overall {
  margin: 28px 0 8px; padding: 22px 24px; border-radius: 14px; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.overall h1 { font-size: 22px; margin: 0; line-height: 1.3; }
.overall p { margin: 2px 0 0; }
.overall-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--none); }
.overall-icon::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); }
.overall.st-operational { background: var(--ok-soft); border-color: transparent; }
.overall.st-operational .overall-icon { background: var(--ok); }
.overall.st-maintenance { background: var(--maint-soft); border-color: transparent; }
.overall.st-maintenance .overall-icon { background: var(--maint); }
.overall.st-outage { background: var(--major-soft); border-color: transparent; }
.overall.st-outage .overall-icon { background: var(--major); }
.overall.st-partial .overall-icon { background: var(--minor); }
.updated { font-size: 13px; text-align: right; white-space: nowrap; }

/* blocks */
.block { margin-top: 30px; }
.block h2 { font-size: 17px; margin: 0 0 12px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.block-head h2 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.sq { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sq.ok { background: var(--ok); } .sq.minor { background: var(--minor); } .sq.major { background: var(--major); } .sq.none { background: var(--none); }

/* notices */
.notices { display: grid; gap: 12px; }
.notice { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--maint); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.notice.incident { border-left-color: var(--major); }
.notice h3 { margin: 0; font-size: 15px; }
.notice .meta { font-size: 13px; color: var(--muted); margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.notice p { margin: 0; white-space: pre-line; font-size: 14px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--maint-soft); color: var(--maint); font-weight: 500; }
.tag.incident { background: var(--major-soft); color: var(--major); }
.tag.upcoming { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* components */
.groups { display: grid; gap: 14px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.comp { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: 0; }
.comp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comp-name { font-weight: 500; }
.comp-name small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.state { font-size: 13px; font-weight: 500; white-space: nowrap; }
.state.operational { color: var(--ok); } .state.maintenance { color: var(--maint); } .state.outage { color: var(--major); } .state.unknown { color: var(--muted); }
.bars { display: flex; gap: 2px; height: 30px; margin-top: 10px; }
.bars i { flex: 1; border-radius: 2px; background: var(--none); min-width: 2px; cursor: default; }
.bars i.ok { background: var(--ok); } .bars i.minor { background: var(--minor); } .bars i.major { background: var(--major); }
.bars i:hover, .bars i:focus { opacity: .7; outline: none; }
.bars-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; gap: 8px; }
.bars-foot b { color: var(--text); font-weight: 500; }

/* latency */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.latency { border-collapse: collapse; width: 100%; font-size: 13px; }
.latency th, .latency td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.latency th { font-weight: 500; color: var(--muted); }
.latency th.row { text-align: left; color: var(--text); }
.latency td { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.latency td.self { color: var(--none); }
.latency td.good { color: var(--ok); } .latency td.fair { color: var(--minor); } .latency td.slow { color: var(--major); }
.latency tr:last-child th, .latency tr:last-child td { border-bottom: 0; }

/* history */
.history { display: grid; gap: 4px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.day h3 { margin: 0 0 6px; font-size: 14px; }
.day ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.day li { font-size: 14px; }
.day li .muted { font-size: 13px; }
.empty { color: var(--muted); font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }

.about p { margin: 0; font-size: 14px; }
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 28px; font-size: 13px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.tip {
  position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px;
  padding: 6px 9px; border-radius: 6px; max-width: 240px; line-height: 1.45; box-shadow: var(--shadow);
}

.overall.loading .overall-icon { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .overall.loading .overall-icon { animation: none; } }

@media (max-width: 640px) {
  .top-in { height: 56px; }
  .brand small { display: none; }
  .top-nav { gap: 10px; }
  #site-link { display: none; }
  .overall { grid-template-columns: auto 1fr; padding: 18px; }
  .overall h1 { font-size: 19px; }
  .updated { grid-column: 1 / -1; text-align: left; }
  .bars i:nth-child(-n+60) { display: none; }   /* phones: the last 30 days */
  .bars { height: 26px; }
}
.d30 { display: none; }
@media (max-width: 640px) { .d90 { display: none; } .d30 { display: inline; } }

/* Laptop and desktop screens: at 80 % like the rest of the site; phones keep the full size. */
@media (min-width: 1024px) { html { zoom: 0.8; } }
