/* ==========================================================================
   服务健康看板 · 组件样式
   视觉体系：阿里云控制台（全站直角、12px 基准、#0064c8 主蓝、112px 内容内边距）
   几何数值来自 docs/reference/ 的实测取证，关键处标注了实测值。
   ========================================================================== */

/* ==========================================================================
   1 · 滚动进度
   ========================================================================== */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: var(--z-toast);
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
}

/* ==========================================================================
   2 · 顶栏（实测 64px，深色，全局全宽，左右留白 24px 而非内容内边距）
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-h);
  background: #1a1a1a;
  color: #ffffff;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 100%;
  padding-inline: 24px;
}

.topbar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0 6px;
}
.topbar-burger span {
  display: block;
  height: 2px;
  background: currentColor;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: #ffffff;
  flex: none;
}
.topbar-brand:hover { color: #ffffff; }
.brand-logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.logo-mark { width: 26px; height: 26px; }
/* 品牌可替换后，文字标与自定义位图必须落在同一个 26px 盒子里 ——
   换 logo 把顶栏撑高，会连带改掉吸顶表头的偏移量，那是一个看不见的连锁反应。 */
.logo-text {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: var(--on-brand);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
}
.logo-custom,
.logo-custom svg { display: block; width: 26px; height: 26px; }
.logo-img { display: block; width: 26px; height: 26px; object-fit: contain; }
.brand-name {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: var(--sp-4);
}
.topbar-nav a {
  padding: 0 10px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-base);
  color: #d9d9d9;
  white-space: nowrap;
  transition: color var(--t-fast) linear, background-color var(--t-fast) linear;
}
.topbar-nav a:hover,
.topbar-nav a.is-active { color: #ffffff; background: rgba(255, 255, 255, .1); }

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 320px;
  height: 32px;
  margin-left: auto;
  padding: 0 10px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid transparent;
  transition: background-color var(--t-fast) linear, border-color var(--t-fast) linear;
}
.topbar-search:focus-within { background: #ffffff; }
.topbar-search .ico { width: 14px; height: 14px; color: #8c8c8c; flex: none; }
.topbar-search:focus-within .ico { color: var(--g60); }
.topbar-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: var(--fs-base);
  outline: none;
}
.topbar-search input::placeholder { color: #8c8c8c; }
.topbar-search:focus-within input { color: var(--text); }
.topbar-search:focus-within input::placeholder { color: var(--g40); }
.topbar-search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #8c8c8c;
}
.search-clear .ico { width: 12px; height: 12px; color: inherit; }
.search-clear:hover { color: var(--text); }
.topbar-search:focus-within .search-clear { color: var(--g40); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: none;
}
.topbar-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #cccccc;
  transition: color var(--t-fast) linear, background-color var(--t-fast) linear;
}
.topbar-icon:hover { color: #ffffff; background: rgba(255, 255, 255, .12); }
.topbar-icon .ico { width: 16px; height: 16px; }

.topbar-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, .22);
}
.topbar-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  font-size: var(--fs-base);
  color: #d9d9d9;
  white-space: nowrap;
  transition: color var(--t-fast) linear;
}
.topbar-link:hover { color: #ffffff; }

/* 主题图标显隐 */
.only-dark { display: none; }
[data-theme="dark"] .only-light { display: none; }
[data-theme="dark"] .only-dark { display: block; }

/* ==========================================================================
   3 · Hero 横幅（实测 banner 200px + cover；标题块 padding-left 112px / top 44px）
   ========================================================================== */
.hero { position: relative; }
.hero-banner {
  position: absolute;
  inset: 0;
  height: var(--hero-h);
  background: url("/assets/banner.svg") center right / cover no-repeat;
  background-color: var(--surface);
  pointer-events: none;
}
[data-theme="dark"] .hero-banner { opacity: .1; }

.hero-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-8);
  min-height: var(--hero-h);
  padding-top: 44px;
  padding-bottom: 32px;
}

.hero-title-block { min-width: 0; }
.hero-title {
  font-size: var(--fs-hero);
  line-height: 48px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0;
}
.hero-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: var(--fs-md);
  line-height: 18px;
  font-weight: 500;
  color: var(--text);
  flex-wrap: wrap;
}
.hero-div {
  display: inline-block;
  width: 0;
  height: 12px;
  border-right: 2px solid var(--g30);
}
.hero-updated {
  font-size: var(--fs-sm);
  line-height: 18px;
  font-weight: 400;
  color: var(--text-2);
}
.hero-updated time { font-family: var(--font-mono); }

/* 指标簇：右对齐，用细分隔线分栏 */
.stat-grid {
  display: flex;
  align-items: stretch;
  flex: none;
  padding-top: 40px;
}
.stat {
  min-width: 132px;
  padding: 0 var(--sp-6);
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-label {
  font-size: var(--fs-2xs);
  line-height: 18px;
  color: var(--text-2);
  white-space: nowrap;
}
.stat-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: var(--sp-1);
  font-size: var(--fs-xl);
  line-height: 30px;
  font-weight: 500;
  color: var(--text);
}
.stat-value small {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-2);
}
.stat-foot {
  margin-top: 2px;
  font-size: var(--fs-2xs);
  line-height: 18px;
  color: var(--text-3);
  white-space: nowrap;
}
.stat[data-tone="ok"] .stat-value { color: var(--ok); }
.stat[data-tone="warn"] .stat-value { color: var(--degraded); }
.stat[data-tone="danger"] .stat-value { color: var(--outage); }
.stat[data-tone="info"] .stat-value { color: var(--text); }

/* ==========================================================================
   4 · 全局状态条（实测 40px，bg rgba(249,142,26,.05)，backdrop-blur 2px）
   这里把同一档 5–6% 的极浅色调按状态语义着色，保持同一种「极轻染色」处理。
   ========================================================================== */
.status-strip {
  position: relative;
  height: var(--strip-h);
  background: var(--ok-bg);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.status-strip[data-tone="degraded"] { background: var(--degraded-bg); }
.status-strip[data-tone="outage"] { background: var(--outage-bg); }

.strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 100%;
}
.strip-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
  line-height: 18px;
}
.strip-msg .ico { width: 15px; height: 15px; flex: none; }
.strip-label { font-weight: 500; white-space: nowrap; }
.strip-div {
  display: inline-block;
  width: 0;
  height: 12px;
  margin: 0 var(--sp-1);
  border-right: 2px solid var(--g30);
}
.strip-detail { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-strip[data-tone="ok"] .strip-label,
.status-strip[data-tone="ok"] .strip-msg .ico { color: var(--ok); }
.status-strip[data-tone="degraded"] .strip-label,
.status-strip[data-tone="degraded"] .strip-msg .ico { color: var(--degraded); }
.status-strip[data-tone="outage"] .strip-label,
.status-strip[data-tone="outage"] .strip-msg .ico { color: var(--outage); }
.status-strip.is-loading .strip-label,
.status-strip.is-loading .strip-msg .ico { color: var(--text-3); }

.strip-link {
  flex: none;
  font-size: var(--fs-sm);
  line-height: 18px;
  color: var(--brand-link);
  transition: color var(--t-fast) linear;
}
.strip-link:hover { color: var(--brand-hover); text-decoration: underline; }

/* ==========================================================================
   5 · 页面主体容器
   ========================================================================== */
.page { padding-bottom: var(--sp-14); background: var(--bg); }

/* ==========================================================================
   6 · 区域下划线 Tab（实测 40px 行高，整条底边 1px #d9d9d9，Tab 间距 32px）
   ========================================================================== */
/* ==========================================================================
   7 · 工具栏（实测行高 64px：上 22 + 控件 32 + 下 10）
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 22px 0 10px;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 32px;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 100%;
  min-width: 132px;
  padding: 0 30px 0 10px;
  background: var(--surface);
  border: 1px solid var(--g30);
  border-radius: 0;
  font-size: var(--fs-2xs);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t-fast) linear;
}
.select-wrap:hover select { border-color: var(--brand); }
.select-wrap select:focus { outline: none; border-color: var(--brand); }
.select-wrap .chev {
  position: absolute;
  right: 9px;
  width: 12px;
  height: 12px;
  color: var(--text-3);
  pointer-events: none;
}

.date-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--g30);
  font-size: var(--fs-2xs);
  color: var(--text);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.date-display .ico { width: 13px; height: 13px; color: var(--text-3); font-family: var(--font-sans); }

/* 图例：实测每项 = 16px 圆标 + 8px 间隔 + 文案，整体右对齐 */
.legend {
  display: flex;
  align-items: center;
  gap: 17px;
  flex: none;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--text-strong);
  white-space: nowrap;
}
.legend-item .mark { width: 16px; height: 16px; }

/* 图标基础尺寸：所有 <svg class="ico"> 都靠它归一 */
.ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }
.ico-sm { width: 12px; height: 12px; }

/* ==========================================================================
   8 · 状态标记（实心圆 + 白色字形，对齐参考站的 success-fill 处理）
   ========================================================================== */
.mark { display: block; width: 16px; height: 16px; flex: none; }
.mark[data-s="k"] { color: var(--cell-ok); }
.mark[data-s="d"] { color: var(--cell-degraded); }
.mark[data-s="o"] { color: var(--cell-outage); }
.mark[data-s="m"] { color: var(--cell-maintenance); }
.mark[data-s="u"] { color: var(--unknown); }   /* 无数据用中性灰，不能用极浅的 cell-empty，否则白色字形不可见 */
.mark tspan, .mark text { fill: #ffffff; }

/* ==========================================================================
   9 · 可用性矩阵：类别侧栏（实测 180px，条目 40px，激活态右侧 2px 蓝条）
   ========================================================================== */
.matrix {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  column-gap: var(--sidebar-gap);
  align-items: start;
}

.side-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-2));
  max-height: calc(100dvh - var(--header-h) - var(--sp-6));
  overflow-y: auto;
  background: var(--surface);
}
.side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  height: 40px;
  padding: 0 12px 0 24px;
  font-size: var(--fs-2xs);
  line-height: 40px;
  color: var(--text);
  text-align: left;
  border-right: 2px solid var(--line);
  transition: color var(--t-fast) linear, border-color var(--t-fast) linear;
}
.side-item:hover { color: var(--brand); border-right-color: var(--brand-line); }
.side-item.is-active { color: var(--brand); border-right-color: var(--brand); }
.side-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item-count { font-size: var(--fs-2xs); color: var(--text-3); flex: none; }
.side-item.is-active .side-item-count { color: var(--brand); }

/* ==========================================================================
   10 · 矩阵表（实测：表头 45px / 行 43px / 日列 70px / 网格线 #eaeaea）
   ========================================================================== */
.matrix-main { position: relative; min-width: 0; }

.table-scroll {
  position: relative;
  max-height: calc(100dvh - 244px);
  min-height: 320px;
  overflow: auto;
  background: var(--surface);
  overscroll-behavior: contain;
}

.matrix-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
  /* 行高由「单元格自身的高度」决定。全站 box-sizing:border-box，所以 43px 的
     单元格已含 1px 下边框，整行正好 43px（参考站实测 43px）。只把内层容器设成
     43px 会让行变成 44px —— 这是真实踩到过的 1px 偏差。 */
  height: var(--row-h);
  padding: 0;
  font-size: var(--fs-2xs);
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

/* 表头：吸顶。sticky 的偏移基准是最近的滚动容器（.table-scroll），因此是 top:0 */
.matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--thead-h);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* 首列（服务名）吸左 */
.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  background: var(--surface);
  /* 冻结区与滚动区之间需要一条硬边界，否则横向滚动时日期格会贴着产品名被生硬切断。 */
  border-right: 1px solid var(--line);
}
.matrix-table thead th:first-child { z-index: 6; background: var(--surface-2); }

/* 冻结列 2：当前状态。
   实测（docs/probe-status.txt）：横向滚到 400px 时它被产品列整列盖住 —— 可见宽 0，
   「正常」文案落在 x=218 完全看不见；而「当前状态」恰恰是这张 33 列表最该常驻的一列。
   因此把它一起冻在 left: var(--col-name)。
   z-index 叠放次序（纵横两个方向都要成立）：
     表头滚动格 3 > 冻结列1 2 > 冻结列2 1 > 普通格 auto  ← 纵向：表头压住正文
     表头冻结 6 / 5 > 表头滚动格 3                       ← 横向：冻结格压住滚动格 */
.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
  position: sticky;
  left: var(--col-name);
  z-index: 1;
}
.matrix-table thead th:nth-child(2) { z-index: 5; }

/* 纵向网格线：实测 当前状态列与日期列带 1px #e5e5e5 右边框 */
.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2),
.matrix-table th.is-day,
.matrix-table td.is-day { border-right: 1px solid var(--line-2); }

/* 列宽预算必须完整：table-layout:fixed 下，只要有一列没声明宽度，它就会被挤到 0。
   实测教训 —— 「产品」列漏了宽度被压成 3px，服务名渲染宽度 0px、人眼完全看不见，
   而 DOM 文本断言照样通过（textContent 不反映可见性）。
   宽度统一由 --col-* 令牌声明，别在 JS 里再写一遍，否则两边会漂移。 */
.matrix-table th:first-child,
.matrix-table td:first-child { width: var(--col-name); }
.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) { width: var(--col-status); }
.matrix-table th.is-day,
.matrix-table td.is-day { width: var(--col-day); }
.matrix-table th:last-child,
.matrix-table td:last-child { width: var(--col-tail); }

.matrix-table tbody tr:hover td { background: var(--brand-soft); }
.matrix-table tbody tr:hover td:first-child { background: var(--brand-soft); }
.matrix-table tbody tr.is-selected td { background: var(--brand-soft); }

.svc-cell {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 100%;   /* 高度交给 td 决定，内层只负责撑满 */
  padding: 0 16px;
  overflow: hidden;
}
.svc-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.svc-name:hover { color: var(--brand); }
.svc-ext { width: 12px; height: 12px; color: var(--text-3); flex: none; }
.svc-ext .ico { width: 12px; height: 12px; }

.status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 100%;
}
.status-cell .status-text { font-size: var(--fs-2xs); color: var(--text-2); }

.day-cell {
  display: grid;
  place-items: center;
  height: 100%;
}
.day-cell.is-empty { color: var(--text-3); }
.day-cell > i { display: flex; }   /* 标记外层用 <i> 包一层，避免与伪元素选择器冲突 */

/* 行尾可用性数字（矩阵表最后一列） */
.svc-uptime {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--text-2);
}
.svc-uptime.is-degraded { color: var(--degraded); }
.svc-uptime.is-outage { color: var(--outage); }

/* 类别分组之间的 5px 间隔行 */
.group-gap td {
  height: var(--group-gap);
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

/* 表尾说明与列翻页控件 */
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-3);
  font-size: var(--fs-2xs);
  color: var(--text-3);
}
.table-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-ctrl { display: inline-flex; align-items: center; gap: 2px; }
.scroll-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
  color: var(--text-3);
  transition: color var(--t-fast) linear;
}
.scroll-btn .ico { width: 14px; height: 14px; }
.scroll-btn:hover { color: var(--brand); }
.scroll-btn:disabled { color: var(--line); cursor: not-allowed; }

/* 空态 / 错误态 */
.table-state {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  padding: var(--sp-14) var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}
.table-state .ico { width: 28px; height: 28px; color: var(--text-3); }
.table-state h3 { font-size: var(--fs-h3); font-weight: 500; color: var(--text); }
.table-state p { font-size: var(--fs-2xs); color: var(--text-2); }
.table-state.is-error .ico { color: var(--outage); }

/* ==========================================================================
   11 · 数据说明条（实测 #f0f7ff / padding 8px / radius 2px，与表格列对齐）
   ========================================================================== */
.note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  margin-left: calc(var(--sidebar-w) + var(--sidebar-gap));
  padding: var(--sp-2);
  background: var(--maintenance-bg);
  border-radius: var(--r-note);
}
.note .ico { width: 16px; height: 16px; color: var(--brand); flex: none; margin-top: 1px; }
.note-content { font-size: var(--fs-sm); line-height: 21px; color: var(--text-strong); }

/* ==========================================================================
   12 · 内容区块
   ========================================================================== */
.block { margin-top: var(--sp-14); }

.block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.block-head h2 {
  font-size: var(--fs-h2);
  line-height: 28px;
  font-weight: 500;
  color: var(--text);
}
.block-head p {
  margin-top: var(--sp-1);
  font-size: var(--fs-2xs);
  color: var(--text-2);
}

/* 分段控件 */
.seg { display: inline-flex; align-items: center; }
.seg button {
  height: 28px;
  padding: 0 14px;
  font-size: var(--fs-2xs);
  color: var(--text-2);
  border: 1px solid var(--g30);
  border-left-width: 0;
  background: var(--surface);
  transition: color var(--t-fast) linear, border-color var(--t-fast) linear,
              background-color var(--t-fast) linear;
}
.seg button:first-child { border-left-width: 1px; }
.seg button:hover { color: var(--brand); border-color: var(--brand); }
.seg button.is-active {
  color: var(--on-brand);
  background: var(--brand);
  border-color: var(--brand);
  z-index: 1;
}

/* 正在发生事件 */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-3); }
.live-card {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--degraded);
}
.live-card[data-tone="danger"] { border-left-color: var(--outage); }
.live-card[data-tone="info"] { border-left-color: var(--maintenance); }
.live-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.live-title { font-size: var(--fs-h3); font-weight: 500; color: var(--text); }
.live-detail { margin-top: var(--sp-2); font-size: var(--fs-2xs); line-height: 21px; color: var(--text-2); }
.live-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: var(--fs-2xs);
  color: var(--text-2);
}
.live-facts .ico { width: 12px; height: 12px; vertical-align: -1px; }

/* ==========================================================================
   13 · 事件表（列对齐参考站的历史事件表标签）
   ========================================================================== */
.table-scroll-event { max-height: none; min-height: 0; }
.col-w-date { width: 148px; }
.col-w-svc { width: 180px; }
.col-w-region { width: 180px; }
.col-w-op { width: 140px; }

.event-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.event-table th,
.event-table td {
  height: var(--row-h);
  padding: 0 var(--sp-4);
  font-size: var(--fs-2xs);
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-table thead th {
  height: var(--thead-h);
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
}
.event-table tbody tr:hover td { background: var(--brand-soft); }
.event-table tbody tr.is-open td { background: var(--brand-soft); }
.event-title-cell { color: var(--text-strong); }
.event-sev { display: inline-flex; align-items: center; gap: 6px; }

.event-detail-row td {
  height: auto;
  padding: var(--sp-4);
  background: var(--surface-2);
  white-space: normal;
}
.event-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--sp-3) var(--sp-6);
}
.event-detail-grid dt { font-size: var(--fs-2xs); color: var(--text-3); }
.event-detail-grid dd { margin-top: 2px; font-size: var(--fs-2xs); color: var(--text); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-2xs);
  color: var(--brand-link);
  transition: color var(--t-fast) linear;
}
.link-btn:hover { color: var(--brand-hover); text-decoration: underline; }
.link-btn .ico { width: 12px; height: 12px; }

.list-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
.list-count { font-size: var(--fs-2xs); color: var(--text-3); }

/* 时间线 */
.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 108px 14px minmax(0, 1fr);
  gap: var(--sp-2);
  align-items: start;
  padding: 6px 0;
}
.tl-time { font-size: var(--fs-2xs); color: var(--text-3); font-family: var(--font-mono); }
.tl-dot {
  width: 8px;
  height: 8px;
  margin: 5px 0 0 3px;
  background: var(--g30);
  border-radius: var(--r-full);
  position: relative;
}
.tl-item:not(:last-child) .tl-dot::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  width: 2px;
  height: calc(100% + 10px);
  background: var(--line);
}
.tl-item[data-tone="danger"] .tl-dot { background: var(--outage); }
.tl-item[data-tone="warn"] .tl-dot { background: var(--degraded); }
.tl-item[data-tone="ok"] .tl-dot { background: var(--ok); }
.tl-item[data-tone="info"] .tl-dot { background: var(--maintenance); }
.tl-text { font-size: var(--fs-2xs); color: var(--text); line-height: 21px; }
.tl-state { color: var(--text-3); margin-right: 6px; }

/* ==========================================================================
   15 · 页脚
   ========================================================================== */
.app-footer {
  /* .page 已有 padding-bottom，这里不再叠加外边距，避免露出 body 底色形成白带 */
  margin-top: 0;
  padding: var(--sp-10) 0 var(--sp-6);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.footer-legal {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--sp-6); }
.footer-nav a { font-size: var(--fs-2xs); color: var(--text); }
.footer-nav a:hover { color: var(--brand); }
.footer-copy { margin-top: var(--sp-4); font-size: var(--fs-2xs); color: var(--text-2); }
.footer-fine { margin-top: var(--sp-2); font-size: var(--fs-2xs); color: var(--text-3); }

/* ==========================================================================
   16 · 通用控件
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--sp-4);
  font-size: var(--fs-2xs);
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 0;
  transition: background-color var(--t-fast) linear, color var(--t-fast) linear,
              border-color var(--t-fast) linear;
}
.btn .ico { width: 14px; height: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { color: var(--on-brand); background: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-primary:active:not(:disabled) { background: var(--brand-active); }

.btn-accent { color: #ffffff; background: var(--accent); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }

.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--g30); }
.btn-ghost:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }

/* 浅色语境下的方形图标按钮（抽屉/弹窗关闭） */
.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-2);
  transition: color var(--t-fast) linear, background-color var(--t-fast) linear;
}
.icon-btn:hover { color: var(--brand); background: var(--brand-soft); }
.icon-btn .ico { width: 16px; height: 16px; }

/* 加载态旋转：动画只碰 transform，不触发重排 */
.btn[aria-busy="true"] .spin-on-load,
.spin-on-load[data-spin="1"] { will-change: transform; animation: spin 1s linear infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  font-size: var(--fs-2xs);
  line-height: 18px;
  color: var(--text-2);
  background: var(--g0);
}
.badge[data-tone="ok"] { color: var(--ok-strong); background: var(--ok-bg); }
.badge[data-tone="warn"] { color: var(--degraded-strong); background: var(--degraded-bg); }
.badge[data-tone="danger"] { color: var(--outage-strong); background: var(--outage-bg); }
.badge[data-tone="info"] { color: var(--maintenance-strong); background: var(--maintenance-bg); }
.badge .ico { width: 12px; height: 12px; }

/* ==========================================================================
   17 · 服务详情抽屉
   ========================================================================== */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: var(--overlay);
}
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: calc(var(--z-drawer) + 1);
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-4);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.drawer-eyebrow { font-size: var(--fs-2xs); color: var(--text-3); }
.drawer-head h2 { font-size: var(--fs-h2); font-weight: 500; color: var(--text-strong); margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-5); }
.drawer-section + .drawer-section { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.drawer-section h3 { font-size: var(--fs-sm); font-weight: 500; color: var(--text-strong); margin-bottom: var(--sp-3); }
.drawer-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
.meta-item dt { font-size: var(--fs-2xs); color: var(--text-3); }
.meta-item dd { margin-top: 2px; font-size: var(--fs-sm); color: var(--text); }

/* 近七天可用性：一行一天。状态点 + 日期 + 状态名 + 数值四列，
   数值用等宽字体右对齐，这样 100.000% 与 99.982% 的位数是对齐的。 */
.daily-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.daily-row:last-child { border-bottom: 0; }
.daily-mark { width: 10px; height: 10px; background: var(--cell-ok); }
.daily-mark[data-tone="warn"] { background: var(--cell-degraded); }
.daily-mark[data-tone="danger"] { background: var(--cell-outage); }
.daily-mark[data-tone="info"] { background: var(--cell-maintenance); }
.daily-date { font-size: var(--fs-2xs); color: var(--text); font-variant-numeric: tabular-nums; }
.daily-state { font-size: var(--fs-2xs); color: var(--text-3); }
.daily-uptime { font-size: var(--fs-sm); font-family: var(--font-mono); color: var(--ok); }
.daily-uptime[data-tone="warn"] { color: var(--degraded); }
.daily-uptime[data-tone="danger"] { color: var(--outage); }
.daily-uptime[data-tone="info"] { color: var(--text-3); }
.region-city { color: var(--text-3); }

/* ==========================================================================
   18 · 订阅弹窗
   ========================================================================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--overlay);
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: calc(var(--z-modal) + 1);
  display: flex;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 64px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-4);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: var(--fs-h2); font-weight: 500; color: var(--text-strong); margin-top: 2px; }
.modal-body { padding: var(--sp-5); overflow-y: auto; }
.modal-lead { font-size: var(--fs-2xs); line-height: 21px; color: var(--text-2); }

.field { display: block; margin-top: var(--sp-4); border: 0; padding: 0; }
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-2xs);
  color: var(--text);
  padding: 0;
}
.field input[type="email"] {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: var(--fs-2xs);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--g30);
  border-radius: 0;
  outline: none;
  transition: border-color var(--t-fast) linear;
}
.field input[type="email"]:hover { border-color: var(--brand); }
.field input[type="email"]:focus { border-color: var(--brand); }
.field input[aria-invalid="true"] { border-color: var(--outage); }
.field-error { display: block; margin-top: 4px; font-size: var(--fs-2xs); color: var(--outage); font-style: normal; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); }
.check { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); color: var(--text); cursor: pointer; }
.check input { accent-color: var(--brand); }
.check .ico { width: 13px; height: 13px; color: var(--text-3); vertical-align: -2px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   19 · 气泡提示与轻提示
   ========================================================================== */
.tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  max-width: 280px;
  padding: var(--sp-2) 10px;
  background: rgba(26, 26, 26, .94);
  color: #ffffff;
  border-radius: var(--r-note);
  font-size: var(--fs-2xs);
  line-height: 19px;
  pointer-events: none;
}
.tooltip .tt-head { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.tooltip .swatch { width: 8px; height: 8px; background: var(--sw, #aaa); }
.tooltip .tt-date { margin-top: 2px; color: #d9d9d9; }
.tooltip .tt-desc { margin-top: 2px; color: #bfbfbf; }
.tooltip .tt-time { display: block; margin-top: 4px; color: #d9d9d9; font-family: var(--font-mono); }

.toast-stack {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--sp-2);
  width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  box-shadow: var(--sh-3);
  font-size: var(--fs-2xs);
  cursor: pointer;
  animation: toast-in .18s var(--ease-out);
}
.toast[data-tone="ok"] { border-left-color: var(--ok); }
.toast[data-tone="warn"] { border-left-color: var(--degraded); }
.toast[data-tone="err"] { border-left-color: var(--outage); }
.toast > .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--brand); }
.toast[data-tone="ok"] > .ico { color: var(--ok); }
.toast[data-tone="warn"] > .ico { color: var(--degraded); }
.toast[data-tone="err"] > .ico { color: var(--outage); }
.toast b { display: block; font-weight: 500; color: var(--text-strong); }
.toast p { margin-top: 2px; color: var(--text-2); }
.toast.is-leaving { animation: toast-out .2s var(--ease-in) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

/* ==========================================================================
   20 · 骨架屏（只动 opacity，避免触发布局）
   ========================================================================== */
.skel {
  display: block;
  background: var(--g0);
  /* opacity 关键帧本身已在合成层，但骨架会同时存在几十个节点，
     提前声明 will-change 可避免动画启动瞬间的层创建抖动。 */
  will-change: opacity;
  animation: skel-pulse 1.2s ease-in-out infinite;
}
.skel-line { height: 12px; }
@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* ==========================================================================
   21 · 响应式
   ========================================================================== */
@media (max-width: 1500px) {
  .topbar-search { width: 240px; }
  .stat { min-width: 118px; padding: 0 var(--sp-5); }
}

@media (max-width: 1200px) {
  .topbar-nav { display: none; }
  .stat-grid { display: none; }
}

@media (max-width: 990px) {
  .topbar-search { width: 180px; }
  .topbar-link { display: none; }
  .matrix { grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-3); }
  .side-nav {
    position: static;
    display: flex;
    gap: 0;
    max-height: none;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }
  .side-item {
    width: auto;
    flex: none;
    padding: 0 var(--sp-4);
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }
  .side-item.is-active { border-right: 0; border-bottom-color: var(--brand); }
  .note { margin-left: 0; }
  .table-scroll { max-height: none; }
}

@media (max-width: 720px) {
  .topbar-search { display: none; }
  .topbar-burger { display: flex; }
  .topbar-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: var(--sp-2);
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .topbar-nav.is-open { display: flex; }
  .topbar-nav a { height: 40px; }
  .brand-name { font-size: var(--fs-base); }
  .hero-inner { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
  .hero-title { line-height: 34px; }
  .hero-sub { margin-top: var(--sp-3); font-size: var(--fs-sm); }
  .strip-detail, .strip-div { display: none; }
  /* hero 副标题在窄屏一定会折行，那个 2px 竖线分隔符就孤零零挂在第一行末尾，
     看着像误敲进去的一个字符。折行之后它已经失去分隔意义，直接收掉。 */
  .hero-div { display: none; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-left { flex-wrap: nowrap; gap: var(--sp-2); }
  /* 刷新按钮只留图标：文字占的那 60 多像素正好是工具栏一行放不下的部分。
     按钮已补 aria-label，收起文字不影响可访问名。 */
  #refreshBtn { padding: 0 var(--sp-3); }
  #refreshBtn span { display: none; }
  .legend { gap: var(--sp-3); }
  .drawer { width: 100vw; }
  .drawer-body { padding: var(--sp-4); }
  /* 窄屏只冻「产品」列。两个冻结列（200+170）会把 390px 视口占满，
     日期列永远压在冻结区下面、滑不出来 —— 信息直接不可达。
     收窄后留出约 230px 给日期列，同时始终知道在看哪一项服务。 */
  .matrix-table th:nth-child(2),
  .matrix-table td:nth-child(2) { position: static; left: auto; }
  /* 窄屏不做「隐藏某些列」（table-layout:fixed 下会破坏列基线），改为整表横向滚动 */
  .table-scroll-event { overflow-x: auto; }
  .event-table { min-width: 880px; }
}

/* 超窄屏（375–430px 一类）：顶栏还得再省一档。
   订阅按钮放不下文字就只留铃铛，品牌名优先保住 —— 它是页面上唯一的身份标识。 */
@media (max-width: 480px) {
  #subscribeBtn { padding: 0 var(--sp-3); }
  #subscribeBtn span { display: none; }
  .hero-title { line-height: 30px; }
  .hero-sub { gap: var(--sp-2); }
}
