/* ============================================================
 * 新版探测站 · 全站基础样式（base.css）
 * 设计基调：浅色卡片 + 蓝色主色 + 深蓝顶栏，融合
 *   tcping.cn / tcptest.cn / antping.com / kk.yun 的视觉语言
 * 命名：静态结构统一用 nx- 前缀；探测 JS 动态生成的 tp-* 类在本文件末尾兼容
 * ============================================================ */

:root {
  /* 品牌与功能色 */
  --nx-brand: #2563eb;          /* 主蓝（参考 tcping #2f80ed / tcptest #1677ff） */
  --nx-brand-hover: #1d4ed8;
  --nx-brand-deep: #1e3a8a;
  --nx-brand-soft: #eaf1ff;
  --nx-brand-line: #cfe0ff;
  --nx-success: #16a34a;        /* 成功/优良绿 */
  --nx-success-soft: #e9f8ef;
  --nx-warn: #f59e0b;           /* 警告橙（截图按钮） */
  --nx-danger: #ef4444;         /* 超时红 */
  --nx-purple: #7c3aed;

  /* 中性色 */
  --nx-ink: #1e293b;            /* 主文字 */
  --nx-ink-soft: #475569;
  --nx-muted: #94a3b8;
  --nx-line: #e8edf4;
  --nx-line-soft: #f1f4f9;
  --nx-bg: #f4f6fa;             /* 页面底色 */
  --nx-card: #ffffff;
  --nx-head: #1b2434;           /* 顶栏深蓝黑（参考 antping / tcptest） */
  --nx-head-2: #232f44;

  /* 延迟色阶（参考四站一致的图例） */
  --nx-lat-good: #22c55e;       /* ≤50ms 绿 */
  --nx-lat-ok: #84cc16;         /* 51-100ms 浅绿 */
  --nx-lat-mid: #f59e0b;        /* 101-250ms 橙 */
  --nx-lat-bad: #ef4444;        /* >250ms 红 */
  --nx-lat-timeout: #7c8798;    /* 超时灰 */

  --nx-radius: 12px;
  --nx-radius-sm: 8px;
  --nx-shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .05);
  --nx-shadow-lg: 0 12px 32px rgba(15, 23, 42, .10);
  --nx-font: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--nx-font);
  color: var(--nx-ink);
  background: var(--nx-bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }
img { max-width: 100%; display: block; }

.nx-container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.sr-only, .tp-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== 顶部品牌条（深蓝黑，参考 antping） ===== */
.nx-topbar { background: var(--nx-head); color: #fff; height: 46px; }
.nx-topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nx-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .2px; }
.nx-brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center;
}
.nx-brand-mark svg { width: 17px; height: 17px; }
.nx-brand-text { font-size: 16px; }
.nx-brand-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,.14); color: #cfe0ff; margin-left: 2px;
}
.nx-topbar-links { display: flex; align-items: center; gap: 16px; font-size: 12.5px; }
.nx-topbar-links a { color: #cbd5e1; transition: color .15s; }
.nx-topbar-links a:hover { color: #fff; }
.nx-topbar-sep { width: 1px; height: 14px; background: rgba(255,255,255,.18); }
.nx-topbar-cta {
  background: var(--nx-brand); color: #fff !important; padding: 5px 12px;
  border-radius: 6px; font-weight: 600;
}

/* ===== 主导航（白底，参考 tcping） ===== */
.nx-nav { background: #fff; border-bottom: 1px solid var(--nx-line); position: sticky; top: 0; z-index: 50; }
.nx-nav-inner { display: flex; align-items: center; gap: 4px; height: 52px; overflow-x: auto; scrollbar-width: none; }
.nx-nav-inner::-webkit-scrollbar { display: none; }
.nx-menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nx-menu-link {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 7px 11px; border-radius: 7px; font-size: 13px; color: var(--nx-ink-soft);
  transition: background .15s, color .15s;
}
.nx-menu-link svg { opacity: .8; }
.nx-menu-link:hover { background: var(--nx-line-soft); color: var(--nx-ink); }
.nx-menu-link.is-active { background: var(--nx-brand-soft); color: var(--nx-brand); font-weight: 700; }
.nx-nav-toggle { display: none; }
.nx-drop { position: relative; }
.nx-drop-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 168px;
  background: #fff; border: 1px solid var(--nx-line); border-radius: 10px;
  box-shadow: var(--nx-shadow-lg); padding: 6px; z-index: 60; list-style: none; margin: 6px 0 0;
}
.nx-drop:hover .nx-drop-menu, .nx-drop:focus-within .nx-drop-menu { display: block; }
.nx-drop-item { display: block; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--nx-ink-soft); }
.nx-drop-item:hover { background: var(--nx-line-soft); color: var(--nx-brand); }

/* ===== 通用卡片 ===== */
.nx-card {
  background: var(--nx-card); border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius); box-shadow: var(--nx-shadow); margin-top: 16px;
}
.nx-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--nx-line-soft); flex-wrap: wrap;
}
.nx-card-title { font-size: 15px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.nx-card-body { padding: 16px 18px; }
.nx-note { font-size: 12px; color: var(--nx-muted); }

/* ===== 按钮 ===== */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 8px; padding: 9px 15px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s;
  white-space: nowrap;
}
.nx-btn:active { transform: translateY(1px); }
.nx-btn-primary { background: var(--nx-brand); color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,.25); }
.nx-btn-primary:hover { background: var(--nx-brand-hover); }
.nx-btn-success { background: var(--nx-success); color: #fff; box-shadow: 0 3px 10px rgba(22,163,74,.25); }
.nx-btn-success:hover { background: #15803d; }
.nx-btn-warn { background: var(--nx-warn); color: #fff; box-shadow: 0 3px 10px rgba(245,158,11,.25); }
.nx-btn-warn:hover { background: #d97706; }
.nx-btn-ghost { background: #fff; color: var(--nx-ink-soft); border: 1px solid var(--nx-line); }
.nx-btn-ghost:hover { background: var(--nx-line-soft); }

/* ===== 页脚 ===== */
.nx-footer { background: var(--nx-head); color: #94a3b8; margin-top: 40px; padding: 40px 0 22px; font-size: 13px; }
.nx-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.nx-footer .nx-brand { color: #fff; }
.nx-footer-desc { margin: 14px 0 0; line-height: 1.8; max-width: 280px; }
.nx-footer-title { color: #e2e8f0; font-size: 13px; margin: 0 0 12px; font-weight: 700; }
.nx-footer-link { display: block; margin-bottom: 9px; transition: color .15s; }
.nx-footer-link:hover { color: #fff; }
.nx-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 28px; padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px;
}

/* ===== 联系我们弹窗 ===== */
.nx-contact-modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.nx-contact-modal.open { display: flex; }
.nx-contact-box {
  background: #fff; border-radius: 14px; width: min(440px, 100%); padding: 26px;
  box-shadow: var(--nx-shadow-lg); position: relative;
}
.nx-contact-box h3 { margin: 0 0 6px; font-size: 18px; }
.nx-contact-box p { color: var(--nx-muted); font-size: 13px; margin: 0 0 16px; }
.nx-contact-close {
  position: absolute; top: 12px; right: 14px; border: 0; background: none;
  font-size: 24px; color: var(--nx-muted); cursor: pointer; line-height: 1;
}
.nx-contact-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--nx-line-soft); font-size: 13px; }
.nx-contact-row span:first-child { color: var(--nx-muted); }
.nx-contact-row a { color: var(--nx-brand); font-weight: 600; }

/* ===== Toast ===== */
.nx-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--nx-ink); color: #fff; padding: 11px 20px; border-radius: 8px;
  font-size: 13px; box-shadow: var(--nx-shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 999;
}
.nx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 右下角悬浮联系按钮 ===== */
.nx-float-contact {
  position: fixed; right: 18px; bottom: 26px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--nx-brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(37,99,235,.35); transition: transform .15s, background .15s;
}
.nx-float-contact:hover { transform: translateY(-3px); background: var(--nx-brand-hover); }

/* ===== 移动端抽屉 ===== */
.nx-drawer-mask { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 90; }
.nx-drawer-mask.is-open { display: block; }
.nx-drawer {
  position: fixed; top: 0; left: 0; height: 100%; width: 280px; background: #fff;
  transform: translateX(-100%); transition: transform .25s; z-index: 91; overflow-y: auto;
  box-shadow: var(--nx-shadow-lg);
}
.nx-drawer.is-open { transform: translateX(0); }

@media (max-width: 860px) {
  .nx-topbar-links a:not(.nx-topbar-cta) { display: none; }
  .nx-nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 8px; }
  .nx-nav-toggle span { width: 20px; height: 2px; background: var(--nx-ink-soft); border-radius: 2px; }
  .nx-menu { display: none; }
  .nx-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ===== 结果表线路/家宽/超时标签（JS 动态输出，全局统一） ===== */
.tp-tag.telecom{background:#3b82f6;color:#fff}
.tp-tag.unicom{background:#ef4444;color:#fff}
.tp-tag.mobile{background:#10b981;color:#fff}
.tp-tag.bgp{background:#6366f1;color:#fff}
.tp-tag.hmt{background:#fce7f3;color:#be185d}
.tp-tag.overseas{background:#a855f7;color:#fff}
.tp-probe-home-badge{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600;background:#fef3c7;color:#b45309;line-height:1.4;flex-shrink:0}
.tp-timeout-txt{color:#ef4444;font-weight:600}
