:root {
  --bg: #f6f8fa;
  --card: #ffffff;
  --border: #e7ebef;
  --border-strong: #d6dce2;
  --text: #1b2733;
  --text-soft: #5b6b7b;
  --text-faint: #8a98a6;
  --green: #1fc16b;
  --green-soft: #d7f5e6;
  --yellow: #f5a623;
  --yellow-soft: #fcedd2;
  --red: #fb4b4b;
  --red-soft: #fde0e0;
  --blue: #3b82f6;
  --grey: #dfe5ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.04);
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* header */
.topbar {
  padding: 22px 0 6px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
}
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #1fc16b, #15a85b);
  display: grid; place-items: center; color: #fff; font-weight: 700;
  box-shadow: var(--shadow);
}
.brand .title { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.brand .sub { color: var(--text-faint); font-size: 13px; }

/* summary banner */
.summary {
  margin: 18px 0 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
}
.summary .badge-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: #fff; font-size: 19px; font-weight: 700;
}
.summary .s-text { flex: 1; min-width: 0; }
.summary .s-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.summary .s-meta { color: var(--text-faint); font-size: 13px; margin-top: 2px; }
.summary.operational { background: linear-gradient(180deg, #f3fcf7, #ffffff); }
.summary.operational .badge-dot { background: var(--green); }
.summary.no_data .badge-dot { background: var(--text-faint); }
.summary.degraded .badge-dot { background: var(--yellow); }
.summary.major_outage { background: linear-gradient(180deg, #fff5f5, #ffffff); }
.summary.major_outage .badge-dot { background: var(--red); }
.summary.maintenance .badge-dot { background: var(--blue); }

/* window toggle */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 2px 12px;
}
.section-head h2 { font-size: 15px; font-weight: 600; color: var(--text-soft); margin: 0; }
.toggle {
  display: inline-flex; background: #eef1f4; border-radius: 9px; padding: 3px;
  border: 1px solid var(--border);
}
.toggle button {
  border: 0; background: transparent; color: var(--text-soft);
  font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 7px;
  cursor: pointer; font-weight: 500;
}
.toggle button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.comp {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.comp:last-child { border-bottom: 0; }
.comp.is-group-header { background: #fbfcfd; }
.comp-top {
  display: flex; align-items: center; gap: 10px;
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot.operational { background: var(--green); }
.dot.degraded { background: var(--yellow); }
.dot.major_outage { background: var(--red); }
.dot.maintenance { background: var(--blue); }
.dot.no_data { background: var(--grey); }
.comp-name { font-weight: 600; font-size: 15px; letter-spacing: -0.005em; }
.comp-sub { color: var(--text-faint); font-size: 12.5px; }
.comp-uptime { margin-left: auto; color: var(--text-faint); font-size: 13px; white-space: nowrap; }
.comp-uptime b { color: var(--text-soft); font-weight: 600; }
.sub-row { padding-left: 8px; }

/* uptime bar strip */
.bars {
  display: flex; gap: 3px; margin-top: 12px; height: 30px; align-items: stretch;
}
.bars.dense { gap: 2px; }
.bar {
  flex: 1 1 0; border-radius: 3px; min-width: 0; background: var(--grey);
  transition: transform .08s ease;
  cursor: default;
}
.bar.operational { background: var(--green); }
.bar.degraded { background: var(--yellow); }
.bar.major_outage { background: var(--red); }
.bar.maintenance { background: var(--blue); }
.bar.no_data { background: var(--grey); }
.bar:hover { transform: scaleY(1.12); }
.bars-axis {
  display: flex; justify-content: space-between;
  color: var(--text-faint); font-size: 11.5px; margin-top: 6px;
}

/* tooltip */
.tip {
  position: fixed; z-index: 50; pointer-events: none;
  background: #1b2733; color: #fff; font-size: 12px; line-height: 1.45;
  padding: 7px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  opacity: 0; transition: opacity .1s; max-width: 220px;
}
.tip .tip-d { color: #aebccb; font-size: 11px; }
.tip b { font-weight: 600; }

/* incidents */
.incidents { margin-top: 34px; }
.incidents h2 {
  font-size: 18px; font-weight: 650; margin: 0 2px 4px; letter-spacing: -0.01em;
}
.incidents .hint { color: var(--text-faint); font-size: 13px; margin: 0 2px 16px; }
.month { margin-top: 22px; }
.month-label { font-weight: 600; font-size: 15px; margin: 0 2px 10px; }
.day-block {
  display: grid; grid-template-columns: 64px 1fr; gap: 8px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.day-num { color: var(--text); font-weight: 600; font-size: 15px; }
.day-num small { color: var(--text-faint); font-weight: 500; margin-left: 4px; font-size: 12px; }
.inc {
  border-left: 3px solid var(--grey); padding: 2px 0 2px 14px; margin-bottom: 16px;
}
.inc:last-child { margin-bottom: 0; }
.inc.minor { border-color: var(--yellow); }
.inc.major { border-color: var(--yellow); }
.inc.critical { border-color: var(--red); }
.inc.maintenance { border-color: var(--blue); }
.inc.resolved { border-color: var(--green); }
.inc-head { display: flex; align-items: baseline; gap: 10px; }
.inc-head.clickable { cursor: pointer; }
.inc-head.clickable:hover .inc-title { color: var(--blue); }
.inc-title { font-weight: 600; font-size: 15.5px; }
.inc-chevron {
  color: var(--text-faint); font-size: 17px; line-height: 1; transition: transform .15s ease;
  transform: rotate(90deg); display: inline-block;
}
.inc.expanded .inc-chevron { transform: rotate(270deg); }
.inc.expanded .inc-latest { display: none; }
.inc-time { margin-left: auto; color: var(--text-faint); font-size: 13px; white-space: nowrap; }
.inc-latest { color: var(--text-soft); font-size: 14px; margin-top: 3px; }
.inc-tag {
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px;
  text-transform: none; vertical-align: middle;
}
.tag-investigating { background: var(--red-soft); color: #c4321f; }
.tag-identified { background: var(--yellow-soft); color: #ad6a00; }
.tag-monitoring { background: #e3f0ff; color: #2563c9; }
.tag-resolved { background: var(--green-soft); color: #138a52; }
.timeline { margin-top: 12px; display: none; }
.timeline.open { display: block; }
.tl-item { padding: 8px 0 8px 16px; border-left: 2px solid var(--border); position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--border-strong);
}
.tl-status { font-weight: 600; font-size: 13px; text-transform: capitalize; }
.tl-body { font-size: 14px; color: var(--text-soft); }
.tl-time { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.affected-chips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; background: #eef1f4; color: var(--text-soft);
  padding: 2px 9px; border-radius: 20px;
}

.empty-incidents {
  color: var(--text-faint); font-size: 14px; padding: 22px 0;
  border-top: 1px solid var(--border);
}

footer {
  margin: 44px 0 36px; color: var(--text-faint); font-size: 12.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
footer a { color: var(--text-soft); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.skeleton { color: var(--text-faint); padding: 40px 0; text-align: center; }

@media (max-width: 560px) {
  .summary { padding: 18px; }
  .summary .s-title { font-size: 17px; }
  .day-block { grid-template-columns: 52px 1fr; }
  .bars { height: 26px; }
  .comp-sub { display: none; }
}
