/* ============================================================
   Probe 探针主题 · CF-Server-Monitor
   设计：深空遥测风格，深色优先，支持浅色；强调单色终端感数字
   ============================================================ */

:root {
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 60px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060b14;
  --panel: #0d1626;
  --panel-2: #101b2f;
  --border: #1b2942;
  --border-strong: #2a3c5f;
  --text: #dce7f7;
  --dim: #8296b2;
  --track: #1a2740;
  --shadow: 0 8px 28px rgba(2, 6, 18, 0.5);
  --glow-a: rgba(45, 212, 191, 0.10);
  --glow-b: rgba(56, 189, 248, 0.08);
  --grid-line: rgba(130, 160, 210, 0.05);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f4f7fc;
  --border: #dfe7f2;
  --border-strong: #c6d3e6;
  --text: #132238;
  --dim: #5d7191;
  --track: #e4ebf6;
  --shadow: 0 8px 24px rgba(30, 55, 100, 0.08);
  --glow-a: rgba(45, 212, 191, 0.12);
  --glow-b: rgba(56, 189, 248, 0.10);
  --grid-line: rgba(60, 100, 160, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* 背景装饰：遥测网格 + 双色辉光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 320px at 12% -6%, var(--glow-a), transparent 70%),
    radial-gradient(720px 360px at 88% -10%, var(--glow-b), transparent 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.dim {
  color: var(--dim);
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ================= 布局骨架 ================= */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 26px 40px;
}

.view-enter {
  animation: viewIn 0.32s ease both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ================= 顶栏 ================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.pulse-logo {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 12px var(--accent);
}

.pulse-logo::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  animation: radar 2.2s ease-out infinite;
}

@keyframes radar {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
  color: var(--dim);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
}

.ws-pill.on {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}

.ws-pill.on .pill-dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: blink 1.6s ease infinite;
}

.ws-pill.mid {
  color: var(--warn);
}

.ws-pill.mid .pill-dot {
  background: var(--warn);
}

@keyframes blink {
  50% {
    opacity: 0.35;
  }
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--dim);
  transition: color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.clock {
  font-size: 13px;
  color: var(--dim);
  min-width: 66px;
  text-align: right;
}

/* ================= 统计卡片区 ================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.65;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 6px;
}

.stat-label .ico {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.stat-value {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
}

/* 统计卡：网速固定 10ch 占位，右侧累计流量不随网速波动 */
.stat-value .stat-speed {
  display: inline-block;
  min-width: 10ch;
}

.stat-value .stat-side {
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  white-space: nowrap;
}

.stat-value em {
  font-style: normal;
  font-size: 13px;
  color: var(--dim);
  font-weight: 400;
}

.stat-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--dim);
}

.regions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 18px;
}

/* ================= 工具栏 ================= */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
}

.search-input::placeholder {
  color: var(--dim);
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ================= 分组与卡片 ================= */

.group-section {
  margin-bottom: 26px;
}

.group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.group-title {
  font-size: 15px;
  font-weight: 650;
}

.group-title::before {
  content: "//";
  color: var(--accent);
  margin-right: 7px;
  font-family: var(--mono);
}

.group-count {
  font-size: 12px;
  color: var(--dim);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(308px, 1fr));
  gap: 14px;
}

.srv-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.srv-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.5;
}

.srv-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.srv-card.is-off {
  opacity: 0.62;
}

/* 隐藏服务器（仅登录可见）：虚线边框 + 降透明度 */
.srv-card.is-hidden-srv {
  opacity: 0.75;
  border-style: dashed;
}

.srv-card.is-off:hover {
  opacity: 0.85;
}

.srv-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
  background: var(--dim);
}

.status-dot.on {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: blink 1.8s ease infinite;
}

.status-dot.off {
  background: var(--bad);
}

.srv-title {
  flex: 1;
  min-width: 0;
}

.srv-name {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.srv-sub {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
}

/* meta 行（单行）：内容超出时克隆一份，整体左移 -50% 无缝循环 */
.mq-row {
  display: block;
  overflow: hidden;
  white-space: nowrap;
}

.mq-track {
  display: inline-flex;
  align-items: center;
}

.mq-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}

.mq-row.marquee .mq-track {
  animation: mq-scroll linear infinite;
}

.mq-row.marquee:hover .mq-track {
  animation-play-state: paused;
}

@keyframes mq-scroll {
  to { transform: translateX(-50%); }
}

.tag-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.region-chip,
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 1.5px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--dim);
  background: var(--panel-2);
  white-space: nowrap;
}

.tag-chip {
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 30%, transparent);
}

/* region-chip 复用 tag-chip 外观，仅颜色不同 */
.region-chip {
  color: var(--dim);
  border-color: var(--border);
}

.tag-chip.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.tag-chip.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
}

/* 流量包 chip 的双箭头：缩小尺寸、紧凑并排 */
.tf-chip .ico {
  width: 10px;
  height: 10px;
}

.tf-chip .ico-up {
  margin-left: -2px;
}

.last-seen {
  font-size: 11px;
  flex: none;
  margin-top: 3px;
  min-height: 14px;
  text-align: right;
}

/* 进度条 */

.srv-meters {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.meter-label {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.meter-val {
  font-size: 12px;
  font-weight: 550;
}

.meter-bar {
  height: 7px;
  border-radius: 7px;
  background: var(--track);
  overflow: hidden;
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: 7px;
  width: 0;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.meter-fill.lv-warn {
  background: linear-gradient(90deg, var(--warn), #f59e0b);
}

.meter-fill.lv-bad {
  background: linear-gradient(90deg, var(--bad), #f43f5e);
}

/* 卡片信息行（负载 / 网络 / 月流） */

.srv-info {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--dim);
}

.info-label {
  flex: none;
  width: 28px;
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.info-val {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}

/* 负载显示：1m/5m/15m 标签 + 颜色分级 */

.load-box {
  display: inline-flex;
  gap: 10px;
  align-items: baseline;
}

.ld-val {
  font-size: 12.5px;
  font-weight: 550;
  /* 与网络/流量行等宽：3×50 + 2×10(间隔) = 170px */
  min-width: 50px;
}

.ld-val.good {
  color: var(--ok);
}

.ld-val.mid {
  color: var(--warn);
}

.ld-val.bad {
  color: var(--bad);
}

.net-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.net-item b {
  font-weight: 500;
  color: var(--text);
  display: inline-block;
  min-width: 62px;
}

.ico {
  width: 13px;
  height: 13px;
}

.ico-down {
  color: var(--ok);
}

.ico-up {
  color: var(--accent-2);
}

/* Ping 分项面板 */

.ping-panel {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.pp-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.pp-label {
  color: var(--dim);
  font-weight: 500;
}

.pp-val {
  font-weight: 550;
  color: var(--text);
}

.pp-val.good {
  color: var(--ok);
}

.pp-val.mid {
  color: var(--warn);
}

.pp-val.bad {
  color: var(--bad);
}

/* IP 徽章 */

.ip-chip {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}

/* 旧样式（表格模式仍引用） */

.ping-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 11px;
  border: 1px solid var(--border);
  min-width: 60px;
}

.ping-chip .ico {
  width: 11px;
  height: 11px;
}

.ping-chip.good {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

.ping-chip.mid {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.ping-chip.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
}

.live-row {
  line-height: 1.5;
  white-space: nowrap;
}

/* 卡片底部行：在线时长(左) + 上报(中) + 采集(右)，三项同一行 */

.srv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.srv-bottom .bt-item {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: -0.02em;
  opacity: 0.7;
  white-space: nowrap;
}

/* (+Ns) 固定占位：等宽字体下 6 字符宽，避免位数变化推动布局 */
.srv-bottom .bt-lag {
  display: inline-block;
  min-width: 6ch;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--dim);
  padding: 1.5px 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.meta-item .ico {
  width: 11px;
  height: 11px;
}

/* ================= 圆环模式 ================= */

.ring-row {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  margin: 6px 0 8px;
  padding: 4px 0;
}

.ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ring-svg {
  width: 76px;
  height: 76px;
}

.ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 6;
}

.ring-val {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.5s ease;
}

.ring-val.lv-warn {
  stroke: var(--warn);
}

.ring-val.lv-bad {
  stroke: var(--bad);
}

.ring-txt {
  fill: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.ring-label {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ================= 表格模式 ================= */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.srv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1216px;
  table-layout: fixed;
}

.srv-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--dim);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--panel-2);
}

.srv-table th .ico {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}

.srv-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.srv-table th:nth-child(2) { width: 74px; }
.srv-table th:nth-child(3),
.srv-table th:nth-child(4),
.srv-table th:nth-child(5) { width: 120px; }
.srv-table th:nth-child(6),
.srv-table th:nth-child(7) { width: 112px; }
.srv-table th:nth-child(8) { width: 104px; }
.srv-table th:nth-child(9) { width: 260px; }

.srv-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.srv-table tbody tr:hover {
  background: var(--panel-2);
}

.srv-table tbody tr:last-child td {
  border-bottom: none;
}

.srv-table tr.is-off {
  opacity: 0.55;
}

.t-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.t-sub {
  font-size: 11px;
  color: var(--dim);
  font-weight: 400;
  min-height: 14px;
  display: block;
}

.mini-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.mini-val {
  font-size: 12px;
  min-width: 42px;
  text-align: right;
}

.mini-bar {
  flex: 1;
  height: 5px;
  border-radius: 5px;
  background: var(--track);
  overflow: hidden;
}

.mini-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease;
}

.mini-bar i.lv-warn {
  background: var(--warn);
}

.mini-bar i.lv-bad {
  background: var(--bad);
}

/* ================= 详情页 ================= */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--dim);
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  transition: color 0.15s, border-color 0.15s;
}

.back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.back-btn svg {
  width: 14px;
  height: 14px;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.detail-head .status-dot {
  width: 12px;
  height: 12px;
  margin-top: 0;
}

.detail-title {
  font-size: 21px;
  font-weight: 680;
}

.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--dim);
}

.chip.accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.chip-live {
  min-width: 134px;
  text-align: center;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* 指标磁贴 */

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 13px;
  margin-bottom: 24px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 96px;
}

.tile-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--dim);
  margin-bottom: 7px;
}

.tile-label .ico {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.tile-value {
  font-size: 19px;
  font-weight: 640;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-value.small {
  font-size: 15px;
}

.tile-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 16px;
}

.tile-bar {
  margin-top: 9px;
  height: 5px;
  border-radius: 5px;
  background: var(--track);
  overflow: hidden;
}

.tile-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s ease;
}

.tile-bar i.lv-warn {
  background: var(--warn);
}

.tile-bar i.lv-bad {
  background: var(--bad);
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 2.5px 0;
}

.kv-row .k {
  color: var(--dim);
  flex: none;
}

.kv-row .v {
  text-align: right;
  word-break: break-all;
}

/* Ping 矩阵 */

.ping-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.ping-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  background: var(--panel-2);
}

.ping-cell .p-label {
  font-size: 10.5px;
  color: var(--dim);
}

.ping-cell .p-val {
  font-size: 15px;
  font-weight: 620;
}

.ping-cell .p-loss {
  font-size: 10.5px;
  color: var(--dim);
  min-height: 15px;
}

.ping-cell.good .p-val {
  color: var(--ok);
}

.ping-cell.mid .p-val {
  color: var(--warn);
}

.ping-cell.bad .p-val {
  color: var(--bad);
}

.ip-badges {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.ip-badge {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  color: var(--dim);
}

.ip-badge.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

/* ================= 图表区 ================= */

.charts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.charts-title {
  font-size: 15px;
  font-weight: 650;
}

.charts-title::before {
  content: "//";
  color: var(--accent);
  margin-right: 7px;
  font-family: var(--mono);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 10px;
}

.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.chart-card-title {
  font-size: 13px;
  font-weight: 600;
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--dim);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.probe-chart {
  position: relative;
  width: 100%;
}

.probe-chart svg {
  display: block;
}

.grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.axis-label {
  fill: var(--dim);
  font-size: 10px;
  font-family: var(--mono);
}

.chart-empty {
  fill: var(--dim);
  font-size: 12px;
}

.chart-cross {
  stroke: var(--dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.6;
}

.chart-dot {
  stroke: var(--panel);
  stroke-width: 1.5;
}

.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 128px;
  background: color-mix(in srgb, var(--panel-2) 92%, black);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 11.5px;
  pointer-events: none;
  box-shadow: var(--shadow);
}

html[data-theme="light"] .chart-tip {
  background: rgba(255, 255, 255, 0.96);
}

.chart-tip-time {
  color: var(--dim);
  margin-bottom: 5px;
  font-family: var(--mono);
}

.chart-tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 1px 0;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  flex: none;
}

.chart-tip-row .l {
  color: var(--dim);
}

.chart-tip-row .v {
  margin-left: auto;
  font-weight: 600;
  padding-left: 14px;
}

/* ================= 骨架屏 / 状态块 ================= */

.sk {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    color-mix(in srgb, var(--text) 6%, transparent) 50%,
    transparent 80%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.sk-stat {
  height: 92px;
}

.sk-card {
  height: 196px;
}

.sk-tile {
  height: 96px;
}

.sk-chart {
  height: 240px;
}

.state-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 64px 20px;
  text-align: center;
  color: var(--dim);
}

.state-icon {
  width: 44px;
  height: 44px;
  opacity: 0.6;
}

.state-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 620;
}

.state-desc {
  font-size: 13px;
  max-width: 420px;
}

.btn {
  margin-top: 8px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 13px;
  padding: 8px 22px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.btn:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

/* ================= Turnstile 弹层 / Toast ================= */

.probe-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: viewIn 0.2s ease both;
}

.probe-dialog {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 28px 30px;
  width: min(400px, calc(100vw - 40px));
  text-align: center;
  box-shadow: var(--shadow);
}

.probe-dialog-title {
  font-size: 17px;
  font-weight: 660;
  margin-bottom: 8px;
}

.probe-dialog-desc {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 18px;
}

.probe-dialog-err {
  margin-top: 12px;
  font-size: 12px;
  color: var(--bad);
  min-height: 18px;
}

.ts-holder {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  z-index: 200;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 99px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= 页脚 ================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 26px 22px;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}

.site-footer .f-brand {
  color: var(--accent);
  font-family: var(--mono);
}

/* ================= 响应式 ================= */

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px 14px 32px;
  }

  .site-header {
    padding: 0 14px;
  }

  .clock {
    display: none;
  }

  .brand-sub {
    display: none;
  }

  .cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tiles-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 时间范围按钮 9 个一排太宽，允许换行 */
  .seg {
    flex-wrap: wrap;
  }

  .ws-pill .ws-pill-text {
    display: none;
  }
}

