/* ============================================================
   Zyqwq status — Better Stack「status page v2」风格复刻
   色板 / 字号 / 阴影 / 圆角均取自 status.2x.nz 公共样式
   （Inter 字体自托管于 /fonts/，OFL 许可）
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular-3.12.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter-Medium-3.12.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter-SemiBold-3.12.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold-3.12.woff2') format('woff2');
}

:root {
  --font-inter: 'Inter', 'SF Pro Text', ui-sans-serif, system-ui, -apple-system,
    'BlinkMacSystemFont', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
    'PingFang SC', 'Microsoft YaHei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --shadow-small: 0 4px 7px rgba(0, 0, 0, .03);

  /* Better Stack statuspage 中性色 */
  --n-900: #0f121a;
  --n-800: #191c24;
  --n-700: #21242d;
  --n-600: #2d313c;
  --n-500: #424757;
  --n-400: #585e72;
  --n-300: #70778c;
  --n-200: #8a91a5;
  --n-100: #a7acbb;
  --n-80: #e2e4e9;
  --n-60: #eeeff2;
  --n-40: #f5f5f7;

  /* 状态色（亮色主题） */
  --rgb-green: 5, 150, 105;
  --rgb-red: 185, 28, 28;
  --rgb-blue: 3, 105, 161;
  --rgb-yellow: 217, 119, 6;

  --bg: #ffffff;
  --text: #0f121a;
  --heading: var(--n-800);
  --card-bg: #ffffff;
  --card-border: var(--n-80);
  --row-border: rgba(226, 228, 233, .5);
  --hover: var(--n-40);
  --hover-strong: var(--n-60);
  --tip-bg: #ffffff;
  --tip-border: var(--n-80);
  --tip-shadow: 0 10px 15px rgba(0, 0, 0, .08), 0 4px 7px rgba(0, 0, 0, .05);
  --skel: var(--n-60);
}

.dark {
  /* 状态色（暗色主题） */
  --rgb-green: 16, 185, 129;
  --rgb-red: 248, 113, 113;
  --rgb-blue: 96, 165, 250;
  --rgb-yellow: 245, 158, 11;

  --bg: var(--n-900);
  --text: var(--n-200);
  --heading: #ffffff;
  --card-bg: var(--n-800);
  --card-border: var(--n-700);
  --row-border: var(--n-700);
  --hover: var(--n-700);
  --hover-strong: var(--n-700);
  --tip-bg: var(--n-800);
  --tip-border: var(--n-600);
  --skel: var(--n-700);
}

/* ---------- 基础 ---------- */

html {
  box-sizing: border-box;
  font-family: var(--font-inter);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable both-edges;
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: inline-block; vertical-align: middle; }

a:focus-visible, button:focus-visible {
  outline: 2px solid rgb(var(--rgb-green));
  outline-offset: 2px;
  border-radius: 2px;
}

.t-lg { font-size: 15px; line-height: 1.4; }
.t-sm { font-size: 12px; line-height: 1.5; }
.medium { font-weight: 500; }
.bold { font-weight: 700; }

.ic-op { color: rgb(var(--rgb-green)); }
.ic-dn { color: rgb(var(--rgb-red)); }
.ic-dg { color: rgb(var(--rgb-yellow)); }
.ic-nm { color: var(--n-80); }
.dark .ic-nm { color: var(--n-500); }

/* ---------- 容器 ---------- */

.container {
  width: 100%;
  margin-inline: auto;
  padding: 0 20px;
}
@media (min-width: 540px)  { .container { max-width: 580px; } }
@media (min-width: 802px)  { .container { max-width: 842px; } }
@media (min-width: 1018px) { .container { max-width: 1058px; } }
@media (min-width: 1320px) { .container { max-width: 1360px; } }
@media (min-width: 1536px) { .container { max-width: 96rem; } }

/* ---------- 顶部导航 ---------- */

.nav-spacer { height: 50px; }

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 50px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, .8);
  border-bottom: 1px solid var(--row-border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dark .nav {
  background: rgba(15, 18, 26, .8);
  border-bottom-color: var(--n-700);
}
@media (min-width: 768px) {
  .nav-spacer { display: none; }
  .nav {
    position: relative;
    height: auto;
    padding: 16px 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .dark .nav { background: none; border: 0; }
}

.nav-brand a {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  display: inline-block;
}
.nav-brand a:active { transform: scale(.95); }

.nav-menu {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 16px 24px;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
  background: rgba(255, 255, 255, .8);
  border-bottom: 1px solid var(--row-border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dark .nav-menu { background: rgba(15, 18, 26, .8); border-bottom-color: var(--n-700); }
.nav-menu.open { display: flex; }
@media (min-width: 768px) {
  .nav-menu {
    display: flex !important;
    position: static;
    padding: 0;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    background: none;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.nav-tab {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s, background-color .15s;
}
.nav-tab:hover { color: var(--heading); background: var(--hover-strong); }
.nav-tab:active { transform: scale(.95); }
.nav-tab.active { color: var(--heading); background: var(--hover-strong); }

.nav-right { display: flex; justify-content: flex-end; align-items: center; }

.nav-cta {
  padding: 8px 12px;
  background: var(--n-40);
  border: 1px solid var(--n-80);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-small);
  color: var(--heading);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.dark .nav-cta { background: var(--n-700); border-color: var(--n-600); color: #fff; }
.nav-cta:active { transform: scale(.95); }

.nav-toggle { display: block; padding: 12px; margin: -12px 4px -12px 0; }
.nav-toggle svg { width: 16px; height: 16px; }
@media (min-width: 768px) { .nav-toggle { display: none; } }

/* ---------- Hero ---------- */

.hero {
  margin-top: 64px;
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
@media (min-width: 640px) { .hero { margin-top: 80px; } }

.hero h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--heading);
}
.hero p { margin: 12px 0 0; font-weight: 500; }

.theme-icon-light { display: inline-block; }
.theme-icon-dark { display: none; }
.dark .theme-icon-light { display: none; }
.dark .theme-icon-dark { display: inline-block; }

/* ---------- 卡片 / section ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-small);
  padding: 12px;
  margin-bottom: 48px;
}
@media (min-width: 640px) { .card { margin-bottom: 96px; } }
.card + .card { margin-top: -24px; }
@media (min-width: 640px) { .card + .card { margin-top: -72px; } }

.sec-toggle {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  margin-top: 4px;
  padding: 8px 8px 8px 0;
  border-radius: var(--radius-md);
  transition: background-color .15s;
}
@media (min-width: 640px) { .sec-toggle { padding: 12px 12px 12px 0; } }
.sec-toggle:hover { background: var(--hover); }
.sec-toggle:active { transform: scale(.98); }

.sec-title {
  margin: 0 12px 0 12px;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-weight: 500;
  color: var(--heading);
}
@media (min-width: 640px) { .sec-title { margin: 0 16px; } }

.sec-right { display: flex; align-items: center; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--n-60);
  color: var(--heading);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s;
}
.dark .badge { background: var(--n-600); }
.badge svg { margin-top: -2px; }

.chev {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  color: var(--n-200);
  transition: transform .2s;
}
@media (min-width: 640px) { .chev { margin-right: 8px; } }
.collapsed .chev { transform: rotate(-180deg); }

.sec-body { margin: 0 8px; }
@media (min-width: 640px) { .sec-body { margin: 0 12px; } }
.collapsed .sec-body { display: none; }

/* ---------- 监控行 ---------- */

.row {
  margin-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--row-border);
}
.row:last-child { border-bottom: 0; }

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -4px 0;
  font-weight: 500;
  color: var(--heading);
}
.row-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-grow: 1;
  margin-right: 8px;
  font-size: 15px;
}
.row-name svg { flex-shrink: 0; }
.row-name .nm {
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--heading);
}
.row-up { flex-shrink: 0; color: rgb(var(--rgb-green)); }
.row-up.warn { color: rgb(var(--rgb-yellow)); }
.row-up.bad { color: rgb(var(--rgb-red)); }

.ticks {
  display: flex;
  margin-top: 12px;
}
.tick {
  flex: 1 1 0%;
  width: 100%;
  height: 32px;
  margin-right: 1px;
  border-radius: 1px;
  background: rgb(var(--rgb-green));
}
.tick:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.tick.op:hover { background: rgba(var(--rgb-green), .6); }
.tick.dn:hover { opacity: .6; }

/* xs：只显示最近 30 天 */
@media (max-width: 639.98px) {
  .tick:nth-child(-n+60) { display: none; }
  .tick:nth-child(61) { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
}
/* sm：最近 60 天 */
@media (min-width: 640px) and (max-width: 767.98px) {
  .tick:nth-child(-n+30) { display: none; }
  .tick:nth-child(31) { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
}
/* md+：90 天 */
@media (min-width: 768px) {
  .tick:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
}

/* ---------- 响应时间图 ---------- */

.chart-label {
  margin: 24px 0 0 4px;
  font-weight: 500;
  color: var(--n-300);
}
.chart-wrap {
  position: relative;
  margin-top: 24px;
  height: 150px;
}
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--n-300);
}

/* ---------- 事件列表 ---------- */

.inc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--radius-md);
}
.inc-row:hover { background: var(--hover); }
.inc-left { display: flex; gap: 12px; min-width: 0; }
.inc-ic { flex-shrink: 0; padding: 2px; }
.inc-main { min-width: 0; align-self: center; }
.inc-name {
  font-weight: 500;
  color: var(--heading);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inc-when { font-size: 12px; color: var(--n-300); margin-top: 2px; }
.inc-dur {
  flex-shrink: 0;
  align-self: center;
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}
.inc-none { color: var(--n-300); padding: 8px; }

/* ---------- 错误 / 骨架 ---------- */

.err-box { padding: 8px; }
.err-msg {
  font-size: 12px;
  color: var(--n-300);
  word-break: break-word;
  padding: 12px;
  border: 1px dashed var(--n-80);
  border-radius: var(--radius-md);
}
.dark .err-msg { border-color: var(--n-600); }

.skel {
  background: var(--skel);
  border-radius: var(--radius-md);
  animation: pulse 1.6s ease-in-out infinite;
}
.skel-circle { width: 40px; height: 40px; border-radius: 50%; }
.skel-line { height: 20px; margin-top: 14px; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ---------- 悬浮提示 ---------- */

.tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 16px));
  padding: 6px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  border-radius: var(--radius-md);
  box-shadow: var(--tip-shadow);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  display: none;
}
.tip.show { display: block; }
.tip-date { display: block; font-weight: 500; padding: 4px 6px 2px; }
.tip hr {
  border: 0;
  border-top: 1px solid var(--row-border);
  margin: 6px -6px;
}
.tip-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-md);
}
.tip-row svg { flex-shrink: 0; margin-top: 1px; }
.tip-name { font-weight: 500; color: var(--heading); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tip-dur { font-size: 12px; font-weight: 500; white-space: nowrap; align-self: center; padding: 5px 0; line-height: 1; }
.tip-op { display: flex; align-items: center; gap: 4px; padding: 8px; font-weight: 500; color: var(--heading); }
.tip-op svg { position: relative; top: -1px; }

/* ---------- 页脚 ---------- */

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}
.f-text { font-size: 12px; font-weight: 500; }
.f-link {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--heading);
}
.f-link:hover { text-decoration: underline; }
