:root {
  --ink: #1e2633;
  --muted: #6b7788;
  --line: #e7ebf0;
  --surface: #ffffff;
  --page: #f7f8fa;
  --healthy: #18b67a;
  --incident: #f04452;
  --degraded: #f28a1b;
  --maintenance: #929baa;
  --unknown: #d8dde5;
  --blue: #2667df;
  --shadow: 0 8px 26px rgba(32, 46, 66, 0.07);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--page);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.topbar {
  height: 70px;
  color: #ffffff;
  background: linear-gradient(
    110deg,
    #ff9b00 0%,
    #ff5640 36%,
    #8a3b9a 69%,
    #3926a8 100%
  );
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1320px;
  margin: auto;
  padding: 0 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: 0.2px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(40, 27, 93, 0.18);
}

.brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__name {
  font-size: 19px;
  line-height: 18px;
}

.brand__sub {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  opacity: 0.94;
}

.site-switcher {
  position: relative;
}

.site-trigger {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 224px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  color: #ffffff;
  background: rgba(42, 22, 137, 0.14);
  text-align: left;
}

.site-trigger:hover,
.site-trigger[aria-expanded="true"] {
  background: rgba(42, 22, 137, 0.26);
}

.site-trigger b {
  opacity: 0.85;
}

.site-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 9px);
  right: 0;
  width: 310px;
  max-height: min(520px, calc(100vh - 96px));
  overflow-y: auto;
  padding: 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 9px;
  box-shadow: 0 14px 36px rgba(23, 27, 50, 0.2);
}

.site-menu[hidden],
.page[hidden],
.tip[hidden] {
  display: none;
}

.site-menu__group {
  padding: 7px 6px 4px;
  color: #8b95a5;
  font-size: 12px;
  font-weight: 650;
}

.site-option {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  color: #3a4657;
  background: transparent;
  text-align: left;
}

.site-option:hover,
.site-option.is-active {
  color: #1f5ec7;
  background: #eef4ff;
}

.main {
  max-width: 1320px;
  min-height: calc(100vh - 152px);
  margin: 0 auto;
  padding: 34px 32px 44px;
}

.breadcrumb {
  margin-bottom: 15px;
  color: #8a95a4;
  font-size: 13px;
}

.breadcrumb b {
  color: #4b596c;
  font-weight: 600;
}

.breadcrumb-link {
  padding: 0;
  border: 0;
  color: #4f5f72;
  background: transparent;
}

.breadcrumb-link:hover {
  color: var(--blue);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.intro {
  margin: 7px 0 0;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.updated {
  color: #7f8a99;
  font-size: 13px;
  white-space: nowrap;
}

.overall {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid #d9efe7;
  border-radius: 10px;
  background: #f5fcf8;
}

.overall__dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--healthy);
  box-shadow: 0 0 0 5px rgba(24, 182, 122, 0.13);
}

.overall strong {
  font-size: 16px;
}

.overall span {
  color: #5e6d79;
}

.overall--incident {
  border-color: #f5d8dc;
  background: #fff7f8;
}

.overall--incident .overall__dot {
  background: var(--incident);
  box-shadow: 0 0 0 5px rgba(240, 68, 82, 0.12);
}

.overall--degraded {
  border-color: #f4e1c9;
  background: #fffbf5;
}

.overall--degraded .overall__dot {
  background: var(--degraded);
  box-shadow: 0 0 0 5px rgba(242, 138, 27, 0.12);
}

.overall--maintenance,
.overall--unknown {
  border-color: #e1e5ea;
  background: #fafbfc;
}

.overall--maintenance .overall__dot {
  background: var(--maintenance);
  box-shadow: 0 0 0 5px rgba(146, 155, 170, 0.14);
}

.overall--unknown .overall__dot {
  background: var(--unknown);
  box-shadow: 0 0 0 5px rgba(146, 155, 170, 0.12);
}

.card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.card__title {
  margin: 0;
  font-size: 17px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: #748091;
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.legend--healthy {
  background: var(--healthy);
}

.legend--incident {
  background: var(--incident);
}

.legend--degraded {
  background: var(--degraded);
}

.legend--maintenance {
  background: var(--maintenance);
}

.module-table {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th {
  height: 48px;
  padding: 0 20px;
  color: #586578;
  background: #fafbfd;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

th:nth-child(1) {
  width: 23%;
}

th:nth-child(2) {
  width: 17%;
}

th:nth-child(3) {
  width: 54%;
}

th:nth-child(4) {
  width: 6%;
}

td {
  height: 82px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.module-name {
  color: #263245;
  font-weight: 620;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.state--healthy i {
  background: var(--healthy);
}

.state--incident i {
  background: var(--incident);
}

.state--degraded i {
  background: var(--degraded);
}

.state--maintenance i {
  background: var(--maintenance);
}

.state--unknown i {
  background: var(--unknown);
}

.status-history__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 24px;
  margin-bottom: 5px;
}

.sla-value {
  color: #8a919c;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.timeline {
  display: flex;
  align-items: center;
  gap: 3px;
}

.status-block {
  position: relative;
  flex: 1 1 0;
  min-width: 4px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.status-block:focus-visible {
  z-index: 1;
  outline: 2px solid #345dbe;
  outline-offset: 1px;
}

.status-block[data-status="healthy"] {
  background: var(--healthy);
}

.status-block[data-status="incident"] {
  background: var(--incident);
}

.status-block[data-status="degraded"] {
  background: var(--degraded);
}

.status-block[data-status="maintenance"] {
  background: var(--maintenance);
}

.status-block[data-status="unknown"] {
  background: repeating-linear-gradient(
    135deg,
    #e6eaf0 0 3px,
    #f8f9fb 3px 6px
  );
}

.tip {
  position: fixed;
  z-index: 20;
  max-width: 260px;
  padding: 9px 10px;
  color: #ffffff;
  background: #273649;
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(26, 38, 55, 0.18);
  font-size: 12px;
  pointer-events: none;
}

.row-link {
  padding: 5px 8px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 18px;
}

.row-link:hover {
  color: #144aaf;
}

.card__footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

.history-link {
  padding: 4px 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 600;
}

.history-link:hover {
  color: #174cae;
  text-decoration: underline;
}

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe4eb;
  border-radius: 6px;
  color: #49576a;
  background: #ffffff;
  font-family: inherit;
}

.history-card {
  padding: 23px 24px;
}

.history-empty {
  display: none;
  padding: 45px 0;
  color: #8490a0;
  text-align: center;
}

.month-section + .month-section {
  margin-top: 30px;
  padding-top: 27px;
  border-top: 1px solid #edf0f4;
}

.month-section[hidden] {
  display: none;
}

.month-heading {
  margin: 0 0 20px;
  color: #344256;
  font-size: 16px;
  font-weight: 650;
}

.incident-list {
  position: relative;
  padding-left: 28px;
}

.incident-list::before {
  position: absolute;
  top: 5px;
  bottom: 9px;
  left: 5px;
  width: 1px;
  background: #dfe5ed;
  content: "";
}

.incident-list:empty::before {
  display: none;
}

.incident {
  position: relative;
  padding: 0 0 28px;
}

.incident[hidden] {
  display: none;
}

.incident:last-child {
  padding-bottom: 0;
}

.incident__dot {
  position: absolute;
  top: 3px;
  left: -28px;
  width: 11px;
  height: 11px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #cbd3df;
}

.incident__dot--incident {
  background: var(--incident);
}

.incident__dot--degraded {
  background: var(--degraded);
}

.incident__dot--maintenance {
  background: var(--maintenance);
}

.incident__dot--unknown {
  background: var(--unknown);
}

.sre-note {
  max-width: 100%;
  padding: 15px 16px;
  background: #fcfdff;
  border: 1px solid #e8edf3;
  border-radius: 7px;
}

.sre-note h3 {
  margin: 0;
  color: #273548;
  font-size: 16px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag {
  padding: 3px 7px;
  color: #607083;
  background: #f1f4f8;
  border-radius: 4px;
  font-size: 12px;
}

.tag--incident {
  color: #df3343;
  background: #fff0f1;
}

.tag--degraded {
  color: #d6760b;
  background: #fff5e9;
}

.tag--maintenance {
  color: #737f8f;
  background: #f0f2f5;
}

.note-content {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #edf1f5;
}

.note-content__markdown {
  color: #607083;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.note-content__markdown > :first-child {
  margin-top: 0;
}

.note-content__markdown > :last-child {
  margin-bottom: 0;
}

.note-content__markdown h1,
.note-content__markdown h2,
.note-content__markdown h3,
.note-content__markdown h4,
.note-content__markdown h5,
.note-content__markdown h6 {
  margin: 18px 0 8px;
  color: #273548;
  font-weight: 600;
  line-height: 1.45;
}

.note-content__markdown h1 {
  font-size: 20px;
}

.note-content__markdown h2 {
  font-size: 18px;
}

.note-content__markdown h3 {
  font-size: 16px;
}

.note-content__markdown h4,
.note-content__markdown h5,
.note-content__markdown h6 {
  font-size: 14px;
}

.note-content__markdown p,
.note-content__markdown ul,
.note-content__markdown ol,
.note-content__markdown blockquote,
.note-content__markdown pre,
.note-content__markdown table {
  margin: 8px 0;
}

.note-content__markdown ul,
.note-content__markdown ol {
  padding-left: 24px;
}

.note-content__markdown blockquote {
  padding: 2px 12px;
  color: #748295;
  border-left: 3px solid #d7dfea;
}

.note-content__markdown code {
  padding: 2px 5px;
  color: #b4234d;
  background: #f5f7fa;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.note-content__markdown pre {
  overflow-x: auto;
  padding: 12px 14px;
  background: #f5f7fa;
  border-radius: 6px;
}

.note-content__markdown pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.note-content__markdown a {
  color: var(--brand);
  text-decoration: none;
}

.note-content__markdown a:hover {
  text-decoration: underline;
}

.note-content__markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.note-content__markdown th,
.note-content__markdown td {
  padding: 6px 10px;
  border: 1px solid #dfe5ed;
  text-align: left;
}

.note-content__meta {
  margin-top: 8px;
  color: #748295;
  font-size: 12px;
}

.footer {
  padding: 24px;
  color: #8a95a5;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 720px) {
  .topbar {
    height: 62px;
  }

  .topbar__inner,
  .main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand__name {
    font-size: 17px;
  }

  .site-trigger {
    min-width: 150px;
    font-size: 12px;
  }

  .site-globe {
    display: none;
  }

  .site-menu {
    width: min(310px, calc(100vw - 32px));
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-meta {
    align-items: flex-start;
  }

  .updated {
    white-space: normal;
  }

  .overall {
    align-items: flex-start;
  }

  .overall span {
    display: block;
    margin-top: 4px;
  }

  .card__head {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .history-card {
    padding: 18px;
  }
}
