/* inmargin 状态 · 版式对齐 status.openai.com（incident.io）
   色板与尺寸取自其线上 CSS 的真实变量值，非目测 */
:root {
  --page: #ffffff;
  --white: #ffffff;

  /* incident.io 的暖灰阶（不是 Tailwind slate） */
  --slate-50: #f7f7f8;
  --slate-100: #e4e4e7;
  --slate-200: #cacace;
  --slate-300: #afafb6;
  --slate-400: #95959d;
  --slate-500: #787882;
  --slate-600: #5f5f68;
  --slate-700: #39393f;
  --slate-800: #29292f;
  --slate-900: #161618;

  /* 状态色（content = 主色 / surface = 浅底） */
  --ok: #24c19a;
  --ok-surface: #d8f8f0;
  --slow: #fbbf24;
  --slow-surface: #fef3c7;
  --partial: #f5785c;
  --partial-surface: #fde1d9;
  --down: #f87171;
  --down-surface: #fee2e1;
  --none: #f7f7f8;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 1px 4px rgba(0, 0, 0, .03);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--slate-900);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

.page {
  max-width: 718px;
  margin: 0 auto;
  padding: 16px 8px 40px;
}

/* ── 顶部 ───────────────────────────── */
.head, .banner, .panel, .history-cta, .foot { margin-left: 16px; margin-right: 16px; }

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  margin: 8px 16px 24px;
}

.brand { text-decoration: none; color: inherit; }
.brand h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo { display: block; height: 40px; width: auto; }
.brand-name {
  font-family: "Noto Serif SC", "Noto Serif TC", Georgia, "Songti SC", "SimSun", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #4c5564;
  white-space: nowrap;
}
.brand-sub { color: var(--slate-400); font-weight: 400; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary {
  background: var(--slate-800);
  border-color: var(--slate-900);
  color: var(--white);
}
.btn-primary:hover { background: var(--slate-700); }

.btn-secondary {
  background: var(--white);
  border-color: var(--slate-200);
  color: var(--slate-900);
}
.btn-secondary:hover { background: var(--slate-50); border-color: var(--slate-300); }
.btn-secondary svg { width: 16px; height: 16px; }

/* ── 总状态横幅 ─────────────────────── */
.banner {
  border-radius: var(--radius);
  padding: 1px;
  margin-bottom: 24px;
  background: var(--ok);
  box-shadow: var(--shadow);
}
.banner-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--slate-900);
  background: var(--ok-surface);
  border-radius: 7px 7px 0 0;
}
.banner-body {
  padding: 16px;
  font-size: 14px;
  line-height: 20px;
  color: var(--slate-900);
  background: var(--white);
  border-radius: 0 0 7px 7px;
}
.banner-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--ok);
  flex: none;
}
.banner-ico svg { width: 16px; height: 16px; }

.banner.is-warn { background: var(--slow); }
.banner.is-warn .banner-head { background: var(--slow-surface); }
.banner.is-warn .banner-ico { background: var(--slow); }

.banner.is-down { background: var(--down); }
.banner.is-down .banner-head { background: var(--down-surface); }
.banner.is-down .banner-ico { background: var(--down); }

/* ── 面板（外框用 1px 底色模拟原站 p-px 效果） ── */
.panel {
  background: var(--white);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-50);
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--slate-900);
}
.range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  font-size: 14px;
  line-height: 20px;
  color: var(--slate-400);
}
.range .nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--slate-400);
  cursor: pointer;
  transition: color .15s;
}
.range .nav:hover { color: var(--slate-500); }
.range .nav svg { width: 16px; height: 16px; }
.range-text { color: var(--slate-400); }
.range .chev { color: var(--slate-300); }

.row {
  padding: 12px 16px;
  border-top: 1px solid var(--slate-50);
}
.row:first-child { border-top: 0; }

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 28px;
  margin-bottom: 8px;
}
.row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.row-name h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-desc {
  margin-left: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--slate-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot {
  width: 16px;
  height: 16px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ok);
}
.dot svg { width: 16px; height: 16px; }
.dot.warn { color: var(--slow); }
.dot.down { color: var(--down); }
.dot.none { color: var(--slate-300); }

.uptime {
  font-size: 14px;
  line-height: 21px;
  color: var(--slate-400);
  white-space: nowrap;
}

.chart {
  display: block;
  width: 100%;
  height: 16px;
}
.chart rect {
  transition: fill .15s cubic-bezier(.4, 0, .2, 1),
              transform .15s cubic-bezier(.4, 0, .2, 1);
}
/* 原站 active 态：仅填充色加深（hover 色），并带 1px 上浮 */
.chart rect.active { transform: translateY(-1px); }
.chart rect.active.st-ok { fill: #1fa382; }
.chart rect.active.st-slow { fill: #f59e0b; }
.chart rect.active.st-down { fill: #ef4444; }
.chart rect.active.st-none { fill: #e4e4e7; }

/* 骨架 */
.row-skeleton .skel-line {
  height: 14px;
  width: 40%;
  background: var(--slate-50);
  border-radius: 4px;
  margin-bottom: 10px;
}
.row-skeleton .skel-bar { height: 16px; background: var(--slate-50); border-radius: 2px; }

/* ── 历史按钮与列表 ─────────────────── */
.history-cta {
  display: flex;
  justify-content: center;
  margin: 32px 0 0;
}
.history { margin-top: 24px; }

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--slate-50);
}
.history-item:first-child { border-top: 0; }
.history-item .when {
  flex: none;
  width: 116px;
  font-size: 13px;
  color: var(--slate-400);
}
.history-item .what { font-size: 14px; color: var(--slate-900); }
.history-item .what .to-slow { color: #b45309; }
.history-item .what .to-down { color: #b91c1c; }
.history-item .what .to-ok { color: #0f766e; }
.history-empty { padding: 16px; font-size: 14px; color: var(--slate-400); }

/* ── 页脚 ───────────────────────────── */
.foot {
  margin-top: 56px;
  text-align: center;
  color: var(--slate-400);
}
.powered { font-size: 13px; }
.powered strong { font-weight: 500; color: var(--slate-500); }
.disclaimer {
  margin: 12px auto 0;
  max-width: 560px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--slate-400);
}

@media (max-width: 640px) {
  .page { padding: 12px 12px 32px; }
  .brand h1 { font-size: 20px; }
  .history-item { flex-direction: column; gap: 2px; }
  .history-item .when { width: auto; }
}




/* ── 柱条悬浮气泡（对齐原站 UptimeChart 气泡） ── */
.chart-wrap { position: relative; }
.bar-tip {
  position: absolute;
  top: 15px;
  z-index: 90;
  width: 256px;
  max-width: 60vw;
  padding-top: 4px;
  opacity: 0;
  transform: translateY(-2px) scale(.95);
  transform-origin: top center;
  transition: opacity .2s ease-out, transform .2s ease-out;
  pointer-events: none;
}
.bar-tip.on { opacity: 1; transform: translateY(0) scale(1); }
.bar-tip .bubble {
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 1px 4px rgba(0, 0, 0, .03);
  color: var(--slate-900);
  font-size: 14px;
  line-height: 20px;
}
.bar-tip .tip-date {
  padding: 4px;
  text-align: left;
  white-space: nowrap;
  color: var(--slate-400);
}
.bar-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 4px;
}
.bar-tip .tip-muted { color: var(--slate-400); }
.bar-tip .tip-incident {
  color: var(--slate-900);
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s;
}
.bar-tip .tip-incident:hover { background: var(--slate-50); }
.bar-tip .tip-ico { display: inline-flex; width: 16px; height: 16px; flex: none; }
.bar-tip .tip-ico svg { width: 16px; height: 16px; }

/* ── 分组 ───────────────────────────── */
.group + .group { border-top: 1px solid var(--slate-50); }
.group-row { cursor: default; }
.gchev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--slate-400);
  cursor: pointer;
  font: inherit;
  transition: color .15s;
}
.gchev:hover { color: var(--slate-900); }
.gchev svg {
  width: 10px;
  height: 6px;
  transform: rotate(-90deg);
  transition: transform .2s ease-out;
}
.gchev[aria-expanded="true"] svg { transform: rotate(0deg); }
.gcount {
  font-size: 14px;
  line-height: 20px;
  color: var(--slate-500);
  white-space: nowrap;
}
.subrows { background: var(--page); }
.subrows .sub-row { padding: 12px 16px; border-top: 1px solid var(--slate-50); }
