/* ==========================================================================
   CF 优选域名汇总 — 全站样式
   设计体系：Cloudflare 橙 + 中性灰；间距 / 圆角 / 过渡统一走 CSS 变量
   说明：script.js 依赖的 DOM 结构与 class / CSS 变量契约均已保留
   ========================================================================== */

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

:root {
  /* 品牌色 */
  --primary-color: #f6821f;
  --secondary-color: #fb923c;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --destructive: #ef4444;

  /* 文本与背景 */
  --text-color: #1f2937;
  --text-color-secondary: #6b7280;
  --bg-color: #fcfcfc;
  --card-bg: #ffffff;
  --border-color: #e5e7eb;

  /* 阴影 */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 8px 24px rgba(246, 130, 31, 0.25);

  /* 延迟色阶（script.js getLatencyColor 内联引用，勿改名/勿删） */
  --latency-49: #008236;
  --latency-149: #7ccf00;
  --latency-299: #f59e0b;
  --latency-999: #fb2c36;
  --latency-1000: #82181a;
  --latency-90: rgba(250, 171, 65, 0.5);
  --text-stroke-color: var(--bg-color);

  /* 间距 scale */
  --space-1: 0.25rem;  /* 4px  */
  --space-2: 0.5rem;   /* 8px  */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */

  /* 圆角 token */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* 过渡 token */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* 顶部粘性导航 */
  --nav-height: 64px;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-border: var(--border-color);

  /* 响应式导航改版新增令牌（非破坏性追加，不覆盖任何既有变量） */
  --nav-height-mobile: 52px;                     /* 移动端顶部精简栏高度 */
  --tabbar-height: 56px;                         /* 底部标签栏内容高度 */
  --nav-tab-bg: rgba(255, 255, 255, 0.88);       /* 标签栏底（毛玻璃 + 半透明） */
  --nav-ink: var(--text-color-secondary);        /* 标签默认色 4.84:1 on #fff */
  --nav-ink-active: #c2410c;                     /* 标签激活色 5.18:1 on #fff */
  --nav-tab-tint: rgba(246, 130, 31, 0.12);      /* 图标胶囊底 / 桌面 hover 底 */
  --nav-tab-press: rgba(246, 130, 31, 0.16);     /* 按下态底色 */

  /* 免责声明 */
  --notice-bg: #fffbeb;
  --notice-text: #92400e;
  --notice-border: #f59e0b;

  /* 优选域名页（/#/domains）：页头渐变与可点芯片 */
  --hero-bg: linear-gradient(
    135deg,
    rgba(246, 130, 31, 0.1) 0%,
    rgba(251, 146, 60, 0.055) 55%,
    rgba(245, 158, 11, 0.03) 100%
  );
  --hero-border: rgba(246, 130, 31, 0.28);
  --chip-bg: var(--bg-color);
  --chip-hover-bg: rgba(246, 130, 31, 0.08);
  --focus-ring: var(--primary-color);

  /* 推广板块（在线优选CF官方域名） */
  --promo-bg: linear-gradient(
    135deg,
    rgba(246, 130, 31, 0.14) 0%,
    rgba(251, 146, 60, 0.08) 55%,
    rgba(245, 158, 11, 0.05) 100%
  );
  --promo-border: rgba(246, 130, 31, 0.35);
  --promo-icon-bg: rgba(246, 130, 31, 0.14);
  --promo-sheen: rgba(255, 255, 255, 0.4);
  --promo-glow: 0 10px 28px rgba(246, 130, 31, 0.22);
  --cta-shadow: 0 4px 14px rgba(246, 130, 31, 0.4);
  --cta-shadow-hover: 0 8px 20px rgba(246, 130, 31, 0.45);

  /* IP 详情弹窗改版新增令牌（亮色，非破坏性新增） */
  --panel-bg: #f9fafb;                                 /* 区块卡片底 */
  --panel-border: #eef0f3;                             /* 卡片描边 */
  --hairline: rgba(0, 0, 0, 0.06);                     /* 字段行发丝线 */
  --tile-bg: #ffffff;                                  /* 安全小格底 */
  --tile-border: #e9ecf1;                              /* 安全小格描边 */
  --ip-hero-bg: linear-gradient(
    135deg,
    rgba(246, 130, 31, 0.13) 0%,
    rgba(251, 146, 60, 0.07) 55%,
    rgba(245, 158, 11, 0.04) 100%
  );                                                   /* 头部渐变底 */
  --ip-hero-border: rgba(246, 130, 31, 0.3);           /* 头部下边线 / 风险条上边线 */
  --map-wrap-bg: #eef2f7;                              /* 地图容器底 */
  --scrim: rgba(15, 23, 42, 0.62);                     /* 全屏遮罩 */
}

[data-theme="dark"] {
  --primary-color: #fb923c;
  --secondary-color: #fbbf24;
  --accent-color: #f59e0b;
  --success-color: #34d399;
  --destructive: #f87171;
  --text-color: #f9fafb;
  --text-color-secondary: #9ca3af;
  --bg-color: #111827;
  --card-bg: #1f2937;
  --border-color: #374151;
  --text-stroke-color: var(--bg-color);
  --shadow-glow: 0 8px 24px rgba(251, 146, 60, 0.2);

  --nav-bg: rgba(17, 24, 39, 0.8);

  /* 响应式导航改版新增令牌（暗色覆盖） */
  --nav-tab-bg: rgba(17, 24, 39, 0.86);
  --nav-ink: #9ca3af;                            /* 6.99:1 on #111827 */
  --nav-ink-active: #fb923c;                     /* 7.84:1 on #111827 */
  --nav-tab-tint: rgba(251, 146, 60, 0.16);
  --nav-tab-press: rgba(251, 146, 60, 0.22);

  --notice-bg: #2d2311;
  --notice-text: #fde68a;
  --notice-border: #f59e0b;

  --hero-bg: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.13) 0%,
    rgba(245, 158, 11, 0.07) 55%,
    rgba(246, 130, 31, 0.04) 100%
  );
  --hero-border: rgba(251, 146, 60, 0.34);
  --chip-hover-bg: rgba(251, 146, 60, 0.12);

  --promo-bg: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.16) 0%,
    rgba(245, 158, 11, 0.09) 55%,
    rgba(246, 130, 31, 0.06) 100%
  );
  --promo-border: rgba(251, 146, 60, 0.4);
  --promo-icon-bg: rgba(251, 146, 60, 0.16);
  --promo-sheen: rgba(255, 255, 255, 0.12);
  --promo-glow: 0 10px 28px rgba(251, 146, 60, 0.18);
  --cta-shadow: 0 4px 14px rgba(251, 146, 60, 0.35);
  --cta-shadow-hover: 0 8px 20px rgba(251, 146, 60, 0.4);

  /* IP 详情弹窗改版新增令牌（暗色覆盖） */
  --panel-bg: #182131;                                 /* 区块卡片底 */
  --panel-border: #2b3648;                             /* 卡片描边 */
  --hairline: rgba(255, 255, 255, 0.07);               /* 字段行发丝线 */
  --tile-bg: #1b2436;                                  /* 安全小格底 */
  --tile-border: #2b3648;                              /* 安全小格描边 */
  --ip-hero-bg: linear-gradient(
    135deg,
    rgba(251, 146, 60, 0.16) 0%,
    rgba(245, 158, 11, 0.09) 55%,
    rgba(246, 130, 31, 0.05) 100%
  );                                                   /* 头部渐变底 */
  --ip-hero-border: rgba(251, 146, 60, 0.36);          /* 头部下边线 / 风险条上边线 */
  --map-wrap-bg: #1a2231;                              /* 地图容器底 */
  --scrim: rgba(2, 6, 23, 0.72);                       /* 全屏遮罩 */
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
  transition:
    background-color 0.3s,
    color 0.3s;
  /* Sticky footer：内容不足一屏时页脚贴住视口底部，各页签页脚位置一致 */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* 锚点目标：预留粘性导航高度，避免滚动定位被遮挡
   （id="top" 已迁移至导航栏本身，滚动定位自然落在页首，无需预留） */
#network,
#domains,
#api,
#resources {
  scroll-margin-top: calc(var(--nav-height) + var(--space-3));
}

/* 键盘可达性：统一 focus-visible 焦点环 */
.nav-link:focus-visible,
.nav-brand:focus-visible,
.promo-cta:focus-visible,
.resource-link:focus-visible,
.domain-hit:focus-visible,
.randomize-btn:focus-visible,
.copy-affordance:focus-visible,
.alias-chip:focus-visible,
.copy-btn-sm:focus-visible,
#theme-switcher:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   顶部粘性导航栏（sticky + 毛玻璃）
   -------------------------------------------------------------------------- */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--nav-height);
  padding: 0 var(--space-5);
  /* 背景与毛玻璃已下移到 .top-nav::before：backdrop-filter ≠ none 会让本元素成为
     position:fixed 后代的包含块，直接保留会把移动端底部标签栏锁死在导航条内部。
     伪元素承接后视觉无差异，详见移动端媒体查询中的说明。 */
  background: transparent;
  border-bottom: 1px solid var(--nav-border);
}

.top-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;               /* .top-nav 有 z-index:900，已构成层叠上下文，负 z-index 不会漏到页面底下 */
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 品牌位旁的轻量副标语（移动端隐藏，避免挤占导航空间） */
.brand-tagline {
  flex-shrink: 0;
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-color-secondary);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  /* 导航项加了图标后，图标本身已是视觉分隔符，盒间不再需要大间距。
     这里只收「盒与盒之间的空隙」，不动 .nav-link 的左右内边距，
     因此点击热区宽度不缩水：视觉间距 = 10px(内边距) + 4px(gap) + 10px(内边距) = 24px。 */
  gap: var(--space-1);
  margin-left: auto;
  min-width: 0;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;          /* 原实测 31px，提到 44px 触控下限（不依赖文案长度） */
  padding: 0 10px;           /* 原 padding: var(--space-1) 2px */
  border-radius: var(--radius-sm);
  color: var(--text-color-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

/* 导航图标：内联 SVG，颜色跟随 currentColor（默认灰，hover/激活自动变橙，无需额外规则） */
.nav-link-icon {
  display: inline-flex;
  align-items: center;
}

.nav-link-icon svg {
  width: 17px;               /* 桌面图标略小、笔画略粗，与 0.9rem 文字视觉等重 */
  height: 17px;
  stroke-width: 1.9;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;                /* 下划线随新的左右内边距内收 */
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--nav-ink-active);   /* 原为 var(--primary-color)，白底仅 2.58:1，未达 WCAG AA */
}

.nav-link:hover {
  background: var(--nav-tab-tint);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* 当前页签激活态：常驻深橙 + 下划线（由页签路由脚本切换 .active） */
.nav-link.active::after {
  transform: scaleX(1);
}

/* 导航改版新增的过渡（颜色 / 背景色 / 指示条）在「减少动态效果」下全部关闭。
   移动端媒体查询里 .nav-link-icon 的 transition 与本块特异性相同(0-1-0)且源码更靠后，
   必须用 !important 才能覆盖，故此处对 reduce 覆盖统一加 !important；
   .nav-link::after 为桌面下划线指示器（自带 transform 过渡），一并纳入，确保导航零动效。 */
@media (prefers-reduced-motion: reduce) {

  .nav-link,
  .nav-link-icon,
  .nav-link::after {
    transition: none !important;
  }
}

/* 主题切换按钮（位于导航右侧，id / sun / moon 图标切换机制保持不变） */
#theme-switcher {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

#theme-switcher:hover {
  transform: scale(1.08) rotate(12deg);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow);
}

#theme-switcher svg {
  color: var(--primary-color);
  transition: color var(--transition-base);
}

#theme-switcher .sun-icon {
  display: none;
}

#theme-switcher .moon-icon {
  display: block;
}

[data-theme="dark"] #theme-switcher .sun-icon {
  display: block;
}

[data-theme="dark"] #theme-switcher .moon-icon {
  display: none;
}

/* --------------------------------------------------------------------------
   无障碍工具类（页头 hero 已移除，站点标识由粘性导航品牌位承担）
   -------------------------------------------------------------------------- */

/* 视觉隐藏：屏幕阅读器与搜索引擎可见，页面上不占位 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  /* body 是 flex column，容器作为 flex item 默认 min-width:auto，
     会被内部宽内容（如分流测试表格）顶开并撑破视口；归零后宽度由视口决定，
     超宽内容交给内部 overflow-x 容器滚动 */
  min-width: 0;
  width: 100%;
}

/* --------------------------------------------------------------------------
   区块体系：统一节间距与区块标题（图标 + 标题 + 渐变短线）
   -------------------------------------------------------------------------- */

.section {
  margin-bottom: var(--space-7);
}

.section-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-color);
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 3px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

.section-subtitle {
  margin: calc(var(--space-3) * -1) 0 var(--space-5);
  color: var(--text-color-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* 正文内联 code：说明文案中的参数 / 字段名 */
.section-subtitle code,
.page-hero code,
.step-text code,
.api-note code {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.85em;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   页签路由（单 HTML 多页显示）：.page 容器由内联路由脚本控制 hidden 显隐
   -------------------------------------------------------------------------- */

/* hidden 兜底：防止个别浏览器/样式覆盖导致隐藏页漏显 */
[hidden] {
  display: none !important;
}

/* 页面切换淡入动画 */
.page {
  animation: pageIn var(--transition-base);
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   推广板块：在线优选CF官方域名
   -------------------------------------------------------------------------- */

.promo-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-7);
  background: var(--promo-bg);
  border: 1px solid var(--promo-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

/* 悬停微光扫过效果 */
.promo-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    var(--promo-sheen),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.promo-banner:hover::before {
  left: 120%;
}

.promo-banner:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: var(--promo-glow);
}

.promo-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.promo-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 24px;
  background: var(--promo-icon-bg);
  border: 1px solid var(--promo-border);
  border-radius: var(--radius-md);
}

.promo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.promo-title {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.promo-desc {
  font-size: 0.9rem;
  color: var(--text-color-secondary);
}

.promo-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-full);
  box-shadow: var(--cta-shadow);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.promo-cta svg {
  transition: transform var(--transition-fast);
}

.promo-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--cta-shadow-hover);
}

.promo-cta:hover svg {
  transform: translate(2px, -2px);
}

.promo-cta:active {
  transform: translateY(0);
  box-shadow: var(--cta-shadow);
}

/* --------------------------------------------------------------------------
   免责声明
   -------------------------------------------------------------------------- */

.notice {
  display: flex;
  gap: var(--space-3);
  background: var(--notice-bg);
  border-left: 4px solid var(--notice-border);
  color: var(--notice-text);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-7);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.7;
}

.notice strong {
  display: block;
  margin-bottom: var(--space-2);
}

.notice .notice-icon {
  flex-shrink: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   网络出口信息
   -------------------------------------------------------------------------- */

.port-info {
  background: var(--card-bg);
  padding: var(--space-5);
  margin-bottom: var(--space-7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.port-info code {
  background: var(--bg-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: "Fira Code", "Courier New", monospace;
  border: 1px solid var(--border-color);
}

.network-cards-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.network-card {
  --flag-badge-url: none;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* 关键：grid item 的 min-width 默认为 auto，会被 nowrap 子元素顶开导致列宽随内容变化；
     显式归零后，卡片宽度完全由 grid 轨道（repeat(4, minmax(0, 1fr))）决定，
     脱敏态与真实态列宽恒定，超长内容由内部省略号消化。 */
  min-width: 0;
}

/* 国旗角标：右下角模糊放大的国旗底纹（由 script.js 写入 --flag-badge-url） */
.network-card.has-flag-badge::after {
  content: "";
  position: absolute;
  bottom: -12px;
  right: -3px;
  width: 90px;
  height: 60px;
  background-image: var(--flag-badge-url);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  filter: blur(3.18px) saturate(1.08);
  opacity: 0.2;
  transform: rotate(10deg);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.network-card .network-card-title,
.network-card .network-info-content {
  position: relative;
  z-index: 2;
}

[data-theme="dark"] .network-card.has-flag-badge::after {
  opacity: 0.3;
}

.network-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary-color);
  box-shadow: 0 12px 20px rgba(246, 130, 31, 0.15);
}

.network-card-title {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  /* 标题行不吃 min-content 撑宽：允许在卡片宽度内收缩/换行 */
  min-width: 0;
}

.title-text {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: wrap;
  /* 同上：flex 子项默认 min-width: auto，长副标题（如墙外测试「谷歌(Google)/推特(Twitter)」）
     会顶开卡片；归零并允许收缩，宽度由 .network-card 决定 */
  min-width: 0;
}

.title-main {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
}

.title-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-color-secondary);
}

/* 墙外测试副标题：谷歌 / 推特彩色文本（默认无下划线，悬停显现） */
.tw-subtitle-google {
  color: #3a7ae7;
  text-decoration: none;
}

.tw-subtitle-twitter {
  color: #04abe7;
  text-decoration: none;
}

.tw-subtitle-google:hover,
.tw-subtitle-twitter:hover {
  text-decoration: underline;
}

/* 墙外测试副标题：可点击切换的入口（非当前选中项） */
.cf-subtitle-switch {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cf-subtitle-switch:hover {
  opacity: 0.75;
}

.cf-subtitle-switch:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
  border-radius: 3px;
}

/* 墙外测试副标题：入口之间的分隔符 */
.cf-subtitle-sep {
  color: var(--text-color-secondary);
  opacity: 0.6;
  margin: 0 2px;
}

/* CF 卡副标题：双出口富文本（含可切换 span）时提升不透明度 */
.title-subtitle.cf-subtitle-rich {
  opacity: 1;
}

/* CF 卡副标题：IPv4 出口配色 */
.cf-subtitle-v4 {
  color: #22c55e;
}

/* CF 卡副标题：IPv6 出口配色 */
.cf-subtitle-v6 {
  color: #3b82f6;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-loading {
  background: #fbbf24;
  animation: pulse 1.5s ease-in-out infinite;
}

.status-success {
  background: #10b981;
}

.status-error {
  background: var(--destructive);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.network-info-content {
  padding: 0.5rem;
  /* 透明背景：避免盖住卡片右下角的国旗角标（.network-card.has-flag-badge::after） */
  background: transparent;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.9rem;
  line-height: 1.6;
  /* 归零 flex 容器子项的自动最小尺寸，阻止内部 nowrap 文本反向撑开卡片 */
  min-width: 0;
}

/* IP 点击样式（第一段：交互基础态；第二段：排版细则，顺序与原文件一致） */
.ip-text {
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
}

.ip-text {
  color: var(--text-color);
  font-weight: 600;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 1rem;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 「网络状态」卡的 IP（.ip-text）：热区仅「IP 文本 + 放大镜」两处，行内空白不响应。
   关键在 `width: fit-content`（收缩到内容宽度 = 文本 + ::after 放大镜），不能是 100%。
   注：父级 .network-info-content 是 flex column 容器，子项 inline-block 会被块化计算为
   block —— 收窄靠的是 width 而非 display，故 display 保持 block。 */
.ip-text.clickable {
  display: block;
  position: relative;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}

/* 「网站分流测试」表的 IP（.split-ip）：热区同样只允许落在 IP 文本上（+ 其右侧放大镜
   元素 .split-ip-icon）。权威手段是 `width: fit-content`（收缩到文本宽度），
   使单元格右侧空白脱离点击热区。⚠️ 切勿改成 100%，否则整格都会误触弹窗。 */
.split-ip.clickable {
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
}

/* 放大镜图标（「网络状态」卡由 ::after 提供；分流表由 JS 输出的 .split-ip-icon 元素承担）。
   ::after 为 inline-block 内联跟随 IP 文本右侧，悬停仅放大图标，不整块填充底色。 */
.ip-text.clickable::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-size: 13px 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232196F3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  opacity: 0.9;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.ip-text.clickable:hover::after {
  opacity: 1;
  transform: scale(1.08);
}

/* 查询中的转圈 spinner（占用放大镜位置） */
.ip-text.clickable.is-loading::after {
  background-image: none;
  border: 2px solid rgba(33, 150, 243, 0.25);
  border-top-color: #2196f3;
  border-radius: 50%;
  opacity: 1;
  animation: ipIconSpin 0.9s linear infinite;
}

[data-theme="dark"] .ip-text.clickable.is-loading::after {
  border-color: rgba(144, 202, 249, 0.25);
  border-top-color: #90caf9;
}

@keyframes ipIconSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 查询中由 JS 追加的 spinner span（「网络状态」卡）：内联追加到 IP 文本之后，与放大镜同位 */
.ip-text.clickable .loading-spinner {
  position: static;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(33, 150, 243, 0.25);
  border-top-color: #2196f3;
  border-radius: 50%;
  animation: ipIconSpin 0.9s linear infinite;
}

[data-theme="dark"] .ip-text.clickable .loading-spinner {
  border-color: rgba(144, 202, 249, 0.25);
  border-top-color: #90caf9;
}

/* loading 期间隐藏放大镜 ::after，避免与 spinner 重叠 */
.ip-text.clickable:has(.loading-spinner)::after {
  display: none;
}

.location-text {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-color-secondary);
}

.country-text {
  color: var(--text-color-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
  /* 由 flex-shrink: 0 改为可收缩：地址文本长度随脱敏状态双向变化
     （SG ******** *************** 31 字符 ↔ SG AS31898 Oracle Corporation 27 字符），
     不可让内容决定宽度。min-width:0 + overflow:hidden + 省略号，
     宽度跟随受约束的父级 .location-text，两态恒等。 */
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-info-content .error {
  color: var(--destructive);
  font-style: italic;
}

.network-tip {
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-color-secondary);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   IP 详情弹窗（script.js 动态生成，样式契约完整保留）
   —— 改版后的正式样式（源自 design/ip-detail-redesign-prototype.html）
   结构层级：.ip-detail-content > (.ip-detail-head + .ip-detail-columns)
   注意：不得引入 .ip-detail-body 层，否则会破坏桌面双栏 + 移动端 order 重排
   -------------------------------------------------------------------------- */

.ip-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: ipFadeIn 0.22s ease;
}

@keyframes ipFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.ip-detail-content {
  position: relative;
  width: min(880px, 94vw);
  max-height: min(86vh, 940px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0;
  /* 内边距交给各分区自己控制，头部可做「满宽渐变条」 */
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.42),
    0 8px 20px -8px rgba(0, 0, 0, 0.24);
  animation: ipSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ipSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .ip-detail-modal,
  .ip-detail-content {
    animation: none;
  }

  /* IP 放大镜与查询 spinner：尊重系统「减弱动态效果」。
     选择器必须覆盖两个页面的实现——
     「网络状态」卡的 .ip-text.clickable::after 与 .ip-text.clickable .loading-spinner，
     「网站分流测试」表的 .split-ip-icon（及 .split-ip-icon:hover 的缩放）与 .loading-spinner。
     带 !important：本块位于文件中部，与其后新增的 transition/animation 声明同特异性，
     不加会被后者覆盖。 */
  .ip-text.clickable::after,
  .split-ip-icon,
  .loading-spinner,
  .split-ip-icon:hover,
  .ip-text.clickable:hover::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ---------- 头部：IP 主视觉 + 综合风险徽章 + 复制 + 关闭 ---------- */
.ip-detail-head {
  position: sticky;
  top: 0;
  /* 必须高于 .ip-detail-columns：内容向上滚动时头部要盖住它。
     配合 .ip-detail-map 的 isolation:isolate（把地图内部层级关进盒子），
     两者一起才能保证「地图永不盖住头部」。 */
  z-index: 10;
  padding: 18px 22px 16px;
  background: var(--ip-hero-bg), var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* 头部右侧径向光晕：让主视觉有「被点亮」的焦点感 */
.ip-detail-head::after {
  content: "";
  position: absolute;
  top: -60%;
  right: -6%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 130, 31, 0.18) 0%, transparent 68%);
  pointer-events: none;
}

[data-theme="dark"] .ip-detail-head::after {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.16) 0%, transparent 68%);
}

.ip-head-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.ip-head-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-color-secondary);
  margin-bottom: 6px;
}

.ip-head-eyebrow .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

/* IP 地址：等宽大字，点击即复制（保留 .ip-detail-copy-btn 契约） */
.ip-detail-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 2px 0;
  background: transparent;
  border: none;
  font: inherit;
  color: var(--text-color);
  font-family: "Fira Code", "Courier New", monospace;
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.25;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  word-break: break-all;
  text-align: left;
}

.ip-detail-copy-btn:hover {
  color: var(--primary-color);
}

.ip-detail-copy-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* 复制图标：常态弱化，悬停强调（替代裸 📋 表情，观感更克制） */
.ip-copy-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(246, 130, 31, 0.1);
  color: var(--primary-color);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

[data-theme="dark"] .ip-copy-chip {
  background: rgba(251, 146, 60, 0.14);
}

.ip-detail-copy-btn:hover .ip-copy-chip {
  background: rgba(246, 130, 31, 0.2);
  transform: scale(1.06);
}

.ip-copy-chip svg {
  width: 14px;
  height: 14px;
}

/* 复用原契约的 .ip-detail-copy-icon（此处仅作视觉弱化，保留类名） */
.ip-detail-copy-icon {
  display: none;
}

.ip-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--space-2);
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-color-secondary);
  position: relative;
  z-index: 1;
}

/* meta 单项：标签弱化 + 值强调（把「基本信息」字段搬进头部用） */
.ip-head-meta .meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.ip-head-meta .meta-key {
  font-size: 0.72rem;
  opacity: 0.78;
}

.ip-head-meta .meta-val {
  font-family: "Fira Code", "Courier New", monospace;
  font-weight: 700;
  color: var(--text-color);
}

/* 方案 A：单行横排 —— 高频 4 项常驻，空间不足时自动折行 */
.ip-head-meta--inline {
  row-gap: 5px;
}

.ip-detail-close {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-color-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-base);
}

.ip-detail-close:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(246, 130, 31, 0.08);
  transform: rotate(90deg);
}

.ip-detail-close:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ---------- 综合风险条：徽章 + 风险刻度尺（本条为新增信息可视化） ---------- */
.ip-risk-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ip-hero-border);
}

.ip-risk-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-color-secondary);
}

.ip-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: "Fira Code", "Courier New", monospace;
  white-space: nowrap;
}

/* 风险刻度尺：5 段色阶（与 getAbuseScoreBadgeClass 的档位一一对应） */
.ip-risk-meter {
  flex: 1 1 160px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ip-risk-track {
  position: relative;
  display: flex;
  height: 7px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--border-color);
}

.ip-risk-track i {
  flex: 1;
  display: block;
}

.ip-risk-track i:nth-child(1) {
  background: #10b981;
}

.ip-risk-track i:nth-child(2) {
  background: #22c55e;
}

.ip-risk-track i:nth-child(3) {
  background: #eab308;
}

.ip-risk-track i:nth-child(4) {
  background: #f97316;
}

.ip-risk-track i:nth-child(5) {
  background: #dc2626;
}

.ip-risk-track i.dim {
  opacity: 0.16;
}

/* 合并后的「住宅 / 商用」分隔符：弱化处理，避免抢走类型色的注意力 */
.type-sep {
  margin: 0 5px;
  color: var(--text-color-secondary);
  opacity: 0.55;
  font-weight: 500;
}

.score-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
}

.score-help-icon:hover {
  background: rgba(59, 130, 246, 0.28);
  transform: scale(1.1);
}

[data-theme="dark"] .score-help-icon {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* 评分算法气泡（沿用 script.js toggleScoreTooltip 契约：紧邻 .score-help-icon 的兄弟节点） */
.score-tooltip {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  width: 90%;
  max-width: 420px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--text-color-secondary);
  text-align: left;
  animation: ipFadeIn 0.24s ease;
}

.score-tooltip.show {
  display: block;
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.tooltip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
}

.tooltip-close-hint {
  font-size: 0.72rem;
  opacity: 0.7;
}

.tooltip-section {
  margin-bottom: 14px;
}

.tooltip-section:last-child {
  margin-bottom: 0;
}

.tooltip-section-title {
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 7px;
  font-size: 0.88rem;
}

.formula-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 7px 12px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.formula-name {
  font-weight: 500;
}

.formula-equation code {
  font-family: "Fira Code", "Courier New", monospace;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

[data-theme="dark"] .formula-equation code {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.risk-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  padding: 9px 12px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
}

.risk-list li {
  padding: 2px 0;
  white-space: nowrap;
}

.risk-list li::before {
  content: "•";
  color: var(--primary-color);
  margin-right: 7px;
  font-weight: 700;
}

.domain-note-p {
  margin-top: 6px;
}

/* ---------- 弹窗主体：双栏 ---------- */
/* ⚠️ 禁止新增 .ip-detail-body 包裹层：.ip-detail-columns 必须恒为
   .ip-detail-content 的直接子级，否则桌面双栏与移动端 order 重排会同时失效。
   主体的内边距由 .ip-detail-columns 承担（原 .ip-detail-body 的 padding 下沉至此）。 */
.ip-detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  align-items: start;
  padding: 18px 22px 22px;
}

.ip-detail-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- 区块卡：每个 section 一张浅底卡（替代原「大段虚线分隔」） ---------- */
.ip-detail-section {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.ip-detail-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-color);
}

.ip-detail-section-title .sec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(246, 130, 31, 0.12);
  font-size: 12px;
}

[data-theme="dark"] .ip-detail-section-title .sec-icon {
  background: rgba(251, 146, 60, 0.16);
}

.ip-detail-section-title .sec-count {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-color-secondary);
  opacity: 0.8;
  letter-spacing: 0;
}

/* ---------- 字段行：label 左 / value 右，值统一等宽 ---------- */
.ip-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 7px 0;
  font-size: 0.82rem;
}

.ip-detail-item + .ip-detail-item {
  border-top: 1px solid var(--hairline);
}

.ip-detail-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-color-secondary);
  font-weight: 500;
}

/* 位置信息双列：字段 → 2 列，压缩卡片高度；
   .ip-item-span2 跨两列独占一行（用于「当地时间」这类长值/高频项） */
.ip-sec-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.ip-sec-grid2 .ip-detail-item {
  min-width: 0;
}

/* 双列时行间线由列内相邻项承担；跨列项需自己带上线，避免断线 */
.ip-sec-grid2 .ip-item-span2 {
  grid-column: 1 / -1;
  border-top: 1px solid var(--hairline);
}

/* 双列下 label/value 改为上下堆叠：列宽仅约 150px，
   左右排布会把「Asia/Shanghai」这类长值挤成多行，反而更难读 */
.ip-sec-grid2 .ip-detail-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 0;
}

.ip-sec-grid2 .ip-detail-item + .ip-detail-item {
  border-top: none;
}

/* 两列各自的首行（第 1、2 项）不加分隔线，其余加 */
.ip-sec-grid2 .ip-detail-item:nth-child(n+3) {
  border-top: 1px solid var(--hairline);
}

.ip-sec-grid2 .ip-detail-item.ip-item-span2 {
  border-top: 1px solid var(--hairline);
}

.ip-sec-grid2 .ip-detail-value {
  text-align: left;
  width: 100%;
}

.ip-detail-value {
  min-width: 0;
  text-align: right;
  font-family: "Fira Code", "Courier New", monospace;
  font-weight: 600;
  color: var(--text-color);
  word-break: break-word;
}

.ip-detail-value.muted {
  color: var(--text-color-secondary);
  font-weight: 500;
}

/* 语义色（沿用 style.css 既有类名） */
.success-text {
  color: var(--success-color);
  font-weight: 700;
}

.warning-text {
  color: #f59e0b;
  font-weight: 700;
}

.danger-text {
  color: var(--destructive);
  font-weight: 700;
}

.ip-type-residential {
  color: var(--success-color);
  font-weight: 700;
}

.ip-type-business {
  color: #f59e0b;
  font-weight: 700;
}

.ip-type-hosting {
  color: var(--text-color);
  font-weight: 700;
}

.ip-type-unknown {
  color: var(--text-color-secondary);
  font-weight: 700;
}

/* 评分徽章色阶（getAbuseScoreBadgeClass 返回值依赖，保留） */
.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--destructive);
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-verylow {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-low {
  background: rgba(134, 239, 172, 0.15);
  color: #22c55e;
}

.badge-elevated {
  background: rgba(250, 204, 21, 0.15);
  color: #eab308;
}

.badge-high {
  background: rgba(251, 146, 60, 0.15);
  color: #f97316;
}

.badge-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* 暗色主题下的评分徽章样式优化 */
[data-theme="dark"] .badge-verylow {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .badge-low {
  background: rgba(134, 239, 172, 0.2);
  color: #86efac;
}

[data-theme="dark"] .badge-elevated {
  background: rgba(250, 204, 21, 0.2);
  color: #fde047;
}

[data-theme="dark"] .badge-high {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

[data-theme="dark"] .badge-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* ---------- 安全检测：图标小格矩阵（9 项一眼扫完，替代两列文字表） ---------- */
.ip-sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 7px;
}

.flag-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.flag-tile:hover {
  transform: translateY(-2px);
}

.flag-tile .flag-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-color-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flag-tile .flag-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.86rem;
  font-weight: 800;
  font-family: "Fira Code", "Courier New", monospace;
}

/* 三种态：安全（绿）/ 命中（红）/ 中性提示（黄，如数据中心）/ 未提供（灰） */
.flag-tile.is-clean {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.07);
}

.flag-tile.is-clean .flag-state {
  color: var(--success-color);
}

.flag-tile.is-hit {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.flag-tile.is-hit .flag-state {
  color: var(--destructive);
}

.flag-tile.is-note {
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.08);
}

.flag-tile.is-note .flag-state {
  color: #f59e0b;
}

.flag-tile.is-soft {
  border-color: var(--tile-border);
}

.flag-tile.is-soft .flag-state {
  color: var(--text-color-secondary);
}

/* ---------- 地图（Leaflet 契约类，仅调整几何与底色；瓦片由 initIpDetailMap 注入） ---------- */
.ip-detail-map {
  position: relative;
  /* 原先 190px 在 373px 宽的容器里近似 2:1，气泡一展开就吃掉上半屏；
     抬高到 240px 让视野更接近 3:2，标注点周围留得出可读的上下文 */
  height: 240px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--map-wrap-bg);
  border: 1px solid var(--panel-border);
}

.ip-detail-map-loading,
.ip-detail-map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
}

/* Leaflet 气泡与弹窗卡片风格协调 */
.ip-detail-map .leaflet-popup-content-wrapper,
.ip-detail-map .leaflet-popup-tip {
  background: var(--card-bg);
  color: var(--text-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ---------- 关键：把整张地图关进自己的层叠上下文 ----------
   问题现象：弹窗内容向下滚动时，地图滑到 sticky 头部下面，
   但地图里的「+/- 按钮」「标记点」「瓦片」仍然画在头部之上，把
   IP 标题和风险条盖住。

   原因：Leaflet 内部控件自带很高的 z-index
   （.leaflet-control-zoom = 800、pane 系列 200~700），
   而它们并不受 .ip-detail-map 约束 —— z-index 只在同一层叠上下文中比较，
   .ip-detail-map 未形成上下文时，这些内部元素会「逃逸」到弹窗层面参与比较，
   直接压过 .ip-detail-head 的 z-index。
   注意：仅调低 .leaflet-top/.leaflet-bottom 不够 ——
   .leaflet-control-zoom 是它们的子元素，自带 800，仍然会逃逸出去。

   正解：让 .ip-detail-map 自身成为层叠上下文（isolation:isolate
   配合已有的 position:relative 即可，无需指定 z-index），
   此后内部一切 z-index 都只在地图盒子内比较，物理上不可能再盖到头部。
   这比逐个去压 Leaflet 的控件层级更稳 —— 后者要跟随 Leaflet 版本变化。 */
.ip-detail-map {
  isolation: isolate;
}

/* Leaflet 控件常规层级微调（在隔离上下文内部生效，仅用于地图自身的观感：
   控件不应压住标注点/气泡） */
.ip-detail-map .leaflet-top,
.ip-detail-map .leaflet-bottom {
  z-index: 400;
}

.ip-detail-map .leaflet-control-zoom {
  /* Leaflet 默认 800，压过 popup-pane(700) 与 marker-pane(600)，
     会让按钮浮在标记之上；收到 400 与容器一致 */
  z-index: 400;
}

/* 版权条是交互无关的展示信息，进一步压到瓦片之下会更干净；
   但完全藏起来又违反高德/OSM 的署名要求，故仅降到最低可见层级并弱化观感 */
.ip-detail-map .leaflet-control-attribution {
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.72);
}

/* 暗色主题下协调 Leaflet 控件 */
[data-theme="dark"] .ip-detail-map .leaflet-bar a {
  background: #1f2937;
  color: #e5e7eb;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ip-detail-map .leaflet-bar a:hover {
  background: #374151;
}

[data-theme="dark"] .ip-detail-map .leaflet-control-attribution {
  background: rgba(31, 41, 55, 0.8);
  color: #9ca3af;
}

[data-theme="dark"] .ip-detail-map .leaflet-control-attribution a {
  color: #60a5fa;
}

/* 暗色主题：仅对瓦片窗格做反色滤镜（高德瓦片只提供亮色一套）。
   滤镜只作用于 .leaflet-tile-pane，marker/popup/控件在其他窗格保持原色；
   类的增删由 script.js 的 MutationObserver 随 data-theme 实时切换。
   参数说明：invert(1)+hue-rotate(180deg) 把亮底翻成暗底；
   brightness 不能压太低，否则路网/水域一并糊死（实测 0.9 时全图近黑）。
   这里抬到 1.15 并适度降对比度，让翻色后仍能分辨道路与水面。
   注：OSM 瓦片同样走这套滤镜，明暗两套底图观感一致。 */
.ip-detail-map-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(1.15) contrast(0.82) saturate(0.75);
}

/* 地图标记的悬停提示：与卡片风格统一（气泡默认改为悬停触发，见 script.js）。
   注意必须显式声明 pointer-events:none —— 否则提示框会吃掉鼠标事件，
   表现为「提示一直挂在那儿不消失」，比原来的自动气泡更挡视线。 */
.ip-detail-map .leaflet-tooltip {
  padding: 5px 9px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-color);
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.ip-detail-map .leaflet-tooltip::before {
  border-top-color: var(--border-color);
}

/* ---------- 滥用举报：突出「可联系」语义，弱化排版噪声 ---------- */
.abuse-note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.06);
  font-size: 0.72rem;
  color: var(--text-color-secondary);
  line-height: 1.6;
}

[data-theme="dark"] .abuse-note {
  background: rgba(59, 130, 246, 0.1);
}

/* ---------- 滚动条美化（与全站风格一致） ---------- */
.ip-detail-content::-webkit-scrollbar {
  width: 10px;
  background: transparent;
}

.ip-detail-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.ip-detail-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
  border: 3px solid var(--card-bg);
  background-clip: padding-box;
}

[data-theme="dark"] .ip-detail-content::-webkit-scrollbar-thumb {
  border-color: var(--card-bg);
}

.ip-detail-content::-webkit-scrollbar-thumb:hover {
  border-width: 2px;
}

/* Firefox 滚动条美化（设计稿未覆盖，属增强项，保留） */
@supports (scrollbar-color: var(--primary-color) transparent) {
  .ip-detail-content {
    scrollbar-color: var(--primary-color) transparent;
  }
}

@supports (scrollbar-color: var(--primary-color) transparent) {
  [data-theme="dark"] .ip-detail-content {
    scrollbar-color: var(--primary-color) transparent;
  }
}

/* --------------------------------------------------------------------------
   优选域名页（/#/domains）
   结构：页头区(page-hero) → 主操作区(primary-card) → 延迟统计(chart-shell)
         → 延迟统计(chart-shell) → 免责声明(.notice，样式见上方「免责声明」区块)
   -------------------------------------------------------------------------- */

/* ---------- 页头区：一屏说清「这是什么 + 能给你什么」 ---------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-6) var(--space-5);
  margin-bottom: var(--space-6);
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-xl);
}

.page-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -8%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 130, 31, 0.18) 0%, transparent 68%);
  pointer-events: none;
}

[data-theme="dark"] .page-hero::before {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.16) 0%, transparent 68%);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  margin-bottom: var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--primary-color);
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.page-hero h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.page-hero h2 em {
  font-style: normal;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero p {
  max-width: 62ch;
  font-size: 0.95rem;
  color: var(--text-color-secondary);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-color-secondary);
}

.hero-meta-item b {
  color: var(--text-color);
  font-weight: 700;
}

/* ---------- 主操作区：页面视觉焦点 ---------- */

.primary-card {
  position: relative;
  overflow: hidden;
  padding: var(--space-5);
  margin-bottom: var(--space-7);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.primary-card:hover {
  border-color: var(--hero-border);
  box-shadow: var(--shadow-lg);
}

.primary-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-wildcard {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

[data-theme="dark"] .badge-wildcard {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.badge-triple {
  background: linear-gradient(135deg, #f6821f 0%, #fb923c 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(246, 130, 31, 0.32);
}

.badge-https {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

[data-theme="dark"] .badge-https {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

/* 主域名行：容器内三个平级可点目标 —— 域名(复制) / 骰子(随机) / 复制按钮 */
.domain-copy-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: var(--bg-color);
  border: 1.5px dashed var(--hero-border);
  border-radius: var(--radius-lg);
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base);
}

.domain-copy-row:hover {
  background: var(--chip-hover-bg);
  border-color: var(--primary-color);
}

/* 域名命中区：占满剩余宽度，点击即复制 */
.domain-hit {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.domain-hit .prefix {
  transition: opacity 0.16s ease;
}

.domain-hit.rerolling .prefix {
  opacity: 0;
}

.domain-copy-row .domain-main {
  font-family: "Fira Code", "Courier New", monospace;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-color);
  word-break: break-all;
  line-height: 1.3;
}

.domain-copy-row .domain-main .domain-accent {
  color: var(--primary-color);
}

/* 随机前缀按钮（洗牌隐喻）：置于复制按钮之前 */
.randomize-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-color-secondary);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast);
}

.randomize-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: var(--chip-hover-bg);
}

.randomize-btn svg {
  transition: transform 0.42s ease;
}

.randomize-btn.spinning svg {
  transform: rotate(360deg);
}

.copy-affordance {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(246, 130, 31, 0.35);
  cursor: pointer;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base),
    background-color var(--transition-base);
}

.copy-affordance:hover {
  box-shadow: 0 8px 20px rgba(246, 130, 31, 0.45);
  transform: translateY(-1px);
}

.copy-affordance svg {
  width: 16px;
  height: 16px;
}

/* 已复制态：复制按钮转绿 */
.copy-affordance.copied {
  background: var(--success-color);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

/* 等价别名区：泛域名任意前缀等价，点击直接复制 */
.alias-block {
  margin-top: var(--space-4);
}

.alias-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-color);
}

.alias-label .hint {
  font-weight: 500;
  color: var(--text-color-secondary);
  margin-left: 4px;
}

.alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.alias-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--chip-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--text-color-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.alias-chip:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: var(--chip-hover-bg);
  transform: translateY(-1px);
}

.alias-chip .caret {
  color: var(--text-color-secondary);
  opacity: 0.7;
}

/* 三步使用指引 */
.steps {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-color);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.step {
  display: flex;
  gap: var(--space-3);
}

.step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--chip-hover-bg);
  border: 1px solid var(--hero-border);
  color: var(--primary-color);
  font-size: 0.76rem;
  font-weight: 800;
}

.step-text {
  font-size: 0.85rem;
  color: var(--text-color-secondary);
  line-height: 1.65;
}

.step-text b {
  display: block;
  color: var(--text-color);
  font-weight: 700;
  font-size: 0.87rem;
}

/* 注意：.domain-note-p 被 script.js 的 IP 评分提示 tooltip 复用（评分说明段落），勿删 */
.domain-note-p {
  margin-top: var(--space-2);
}

/* ---------- 延迟统计：图表直接引用 vps789.com，本站不自产数据 ---------- */

.chart-shell {
  padding: var(--space-4);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-color-secondary);
  margin-bottom: var(--space-3);
}

.chart-source {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
}

.chart-source:hover {
  text-decoration: underline;
}

.chart-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

/* --------------------------------------------------------------------------
   API 信息
   -------------------------------------------------------------------------- */

.api-section {
  background: var(--card-bg);
  padding: var(--space-5);
  margin-bottom: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.api-list .api-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
}

/* 运营商徽章：复用站内既有蓝/红/绿语义色 */
.api-carrier {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.carrier-ct {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.carrier-cu {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.carrier-cmcc {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

[data-theme="dark"] .carrier-ct {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

[data-theme="dark"] .carrier-cu {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

[data-theme="dark"] .carrier-cmcc {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.api-url {
  flex: 1 1 260px;
  min-width: 0;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.88rem;
  color: var(--text-color);
  word-break: break-all;
}

.api-desc {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-color-secondary);
}

/* 行内小号复制按钮（复用 copyDomain + toast 链路） */
.copy-btn-sm {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 14px;
  border: 1px solid var(--promo-border);
  background: var(--promo-icon-bg);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base),
    color var(--transition-base);
}

/* API 响应预览：接口返回内容直接展示（同域 fetch，懒加载） */
.api-preview {
  flex-basis: 100%;
  margin-top: var(--space-2);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.api-preview-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-color-secondary);
}

.api-refresh-btn {
  padding: 3px 12px;
  border: 1px solid var(--promo-border);
  background: var(--promo-icon-bg);
  color: var(--primary-color);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}

.api-refresh-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.api-refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.api-preview-body {
  padding: var(--space-3) var(--space-4);
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-color);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow-y: auto;
}

/* 分段着色：IP 加粗 / # 主色 / 备注灰色（textContent 拼接与原文一致） */
.api-preview-row {
  padding: 1px 0;
}

.api-preview-ip {
  font-weight: 700;
  color: var(--text-color);
}

.api-preview-sep {
  color: var(--primary-color);
  font-weight: 700;
}

.api-preview-remark {
  color: var(--text-color-secondary);
}

.api-preview-loading {
  color: var(--text-color-secondary);
}

.api-preview-error {
  color: var(--destructive);
}

.copy-btn-sm:hover {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--cta-shadow);
  transform: translateY(-1px);
}

.copy-btn-sm:active {
  transform: translateY(0);
  box-shadow: none;
}

/* API 使用提示 */
.api-note {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-color);
  font-size: 0.88rem;
  color: var(--text-color-secondary);
}

.api-list {
  list-style: none;
}

.api-list li {
  background: var(--bg-color);
  padding: 0.75rem 1rem;
  margin-bottom: var(--space-2);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text-color-secondary);
  transition: all 0.2s ease;
}

.api-list li:hover {
  transform: translateX(4px);
  background: var(--card-bg);
}

/* --------------------------------------------------------------------------
   更多资源
   -------------------------------------------------------------------------- */

.resources-section {
  background: var(--card-bg);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  margin-top: 0;
  margin-bottom: 0;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
}

.resources-list {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.resource-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-color);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.resource-link > svg {
  flex-shrink: 0;
}

/* 资源卡片文本块：名称 + 功能描述 */
.resource-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.resource-name {
  font-weight: 700;
  font-family: "Fira Code", "Courier New", monospace;
  font-size: 0.92rem;
}

.resource-desc {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-color-secondary);
  line-height: 1.5;
}

.resource-link:hover {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  background: var(--card-bg);
}

/* --------------------------------------------------------------------------
   Toast / 懒加载 / Footer
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--success-color);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) translateX(10px);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

/* 懒加载图片样式 */
.lazy-image {
  filter: blur(20px);
  opacity: 0.6;
  transition:
    filter 0.8s ease-out,
    opacity 0.8s ease-out;
}

.lazy-image.loaded {
  filter: blur(0);
  opacity: 1;
}

.footer {
  background: var(--card-bg);
  padding: 1.5rem 1rem;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-color-secondary);
  font-size: 0.9rem;
}

.footer-note {
  margin-top: var(--space-2);
  font-size: 0.85rem;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.footer a:hover {
  color: var(--secondary-color);
  background: rgba(246, 130, 31, 0.1);
  transform: translateY(-1px);
}

.footer a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.footer a:hover::after {
  transform: scaleX(1);
}

#visit-count {
  color: var(--primary-color);
  font-weight: 700;
  font-family: "Fira Code", "Courier New", monospace;
  transition: color 0.3s ease;
}

/* --------------------------------------------------------------------------
   延迟测试卡片（script.js 动态生成，样式契约完整保留）
   -------------------------------------------------------------------------- */

.latency-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.latency-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  position: relative;
  overflow: hidden;
  /* 降低模糊强度并应用到全卡片 */
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  min-height: 80px;
  display: flex;
  align-items: center;
}

.latency-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
}

.latency-card-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.latency-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.latency-card-icon-wrapper {
  width: 36px;
  height: 36px;
  background: var(--bg-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.latency-card:hover .latency-card-icon-wrapper {
  background: var(--card-bg);
  border-color: var(--primary-color);
}

.latency-card-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

/* GitHub Icon Theme Switching */
.latency-card-icon-wrapper[data-site="github"] {
  color: #181717 !important;
}

[data-theme="dark"] .latency-card-icon-wrapper[data-site="github"] {
  color: #ffffff !important;
}

.latency-card-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.latency-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  text-shadow:
    0 0 8px var(--text-stroke-color),
    0 0 12px var(--text-stroke-color);
}

.latency-card-region {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-color-secondary);
  font-weight: 700;
  text-shadow:
    0 0 5px var(--text-stroke-color),
    0 0 8px var(--text-stroke-color);
}

.latency-status {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Orbitron", sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  font-style: italic;
  color: var(--primary-color);
  text-shadow:
    0 0 10px var(--text-stroke-color),
    0 0 15px var(--text-stroke-color);
  z-index: 3;
}

.latency-status .unit {
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  font-style: normal;
  margin-left: 2px;
  opacity: 0.7;
  vertical-align: baseline;
  text-transform: lowercase;
}

.latency-graph-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
  pointer-events: none;
  opacity: 0.2;
}

.ecg-path {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: d 0.3s ease;
}

.ecg-path-bg {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 1;
  opacity: 0.3;
}

.graph-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--border-color) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--border-color) 0.5px, transparent 0.5px);
  background-size: 20px 20px;
  pointer-events: none;
  opacity: 0.1;
}

.ecg-cursor {
  fill: var(--primary-color);
  opacity: 0.8;
}

/* 兼容性修复 */
.latency-card-region-domestic {
  color: #10b981;
}

.latency-card-region-international {
  color: #3b82f6;
}

/* --------------------------------------------------------------------------
   网站分流测试
   DOM 契约（与 script.js 的 buildSplitTable()/setSplitRowIp()/setSplitRowGeo() 对应）：
   table.split-table > thead(网站|国家|IP|归属地|ASN) + tbody#split-tbody
   tr.split-row[data-target]
     td.split-col-website  > span.split-site > span.split-icon(svg)/span.split-initial + span.split-site-name + span.split-badge*
     td.split-col-country  > span.split-country > img.split-flag + span.split-country-code
     td.split-col-ip       > span.split-ip-wrap > span.split-ip（IP 文本）+ span.split-ip-icon（放大镜）
                            （仅 IP 文本与放大镜可点击弹出 IP 详情弹窗；过长省略号 + title）
     td.split-col-geo      > span.split-geo > .split-geo-place + .split-sub.split-geo-isp
     td.split-col-asn      > span.split-asn > .split-asn-code + .split-sub.split-asn-org
   -------------------------------------------------------------------------- */

.split-section .section-subtitle {
  margin-bottom: var(--space-5);
}

.split-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.split-table {
  width: 100%;
  /* fixed：严格按下方百分比分配列宽，避免 auto 布局下 IP（nowrap）抢走网站列宽度 */
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
  /* 与 .container（max-width 1280 - 2×16 padding - 边框 ≈ 1246）等宽：
     桌面端不产生横向滚动；窄屏时表格主动溢出，由 .split-table-wrap 承接。
     1240px 为实测各列内容均不折行、不截断的最小宽度 */
  min-width: 1240px;
}

.split-table th {
  text-align: left;
  padding: var(--space-3) var(--space-3);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-color-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  background: transparent;
}

.split-table td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.split-table tbody tr:hover {
  background: rgba(246, 130, 31, 0.05);
}

/* 列宽：按各列实测最长内容分配（table-layout:fixed 下百分比被严格遵守）。
   站名统一为品牌名后大幅变短（最长「Cloudflare Mirrors」仅 127px），
   网站列由 25% 收窄至 22%，把余量让给 IP（IPv6 长值集中）与归属地/ASN。
   国家列去掉国名后仅需 ~58px，由 9% 收窄至 7%。
   IP / 归属地 / ASN 均保留省略号兜底，极长内容省略并将完整值写入 title。 */
.split-col-website {
  width: 22%;
}

.split-col-ip {
  width: 24%;
}

.split-col-country {
  width: 7%;
}

.split-col-geo {
  width: 25%;
}

.split-col-asn {
  width: 22%;
}

/* 站点单元格：图标 + 名称（不换行） + 徽章（空间不足时可换到下一行） */
.split-site {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
  min-width: 0;
}

/* 内联品牌图标（SVG） */
.split-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
}

.split-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* 无图标时的首字母占位 */
.split-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary-color);
}

.split-site-name {
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

/* 分类徽章 */
.split-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.66rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* 国内 / 国际 徽章配色与「网络状态」页 latency-card-region 保持一致：
   国内 = #10b981（绿）、国际 = #3b82f6（蓝） */
.split-badge-domestic {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.45);
}

.split-badge-international {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
}

.split-badge-ai {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.45);
}

.split-badge-nsfw {
  color: #db2777;
  background: rgba(219, 39, 119, 0.12);
  border-color: rgba(219, 39, 119, 0.45);
}

.split-badge-crypto {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.45);
}

.split-badge-static {
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.45);
}

/* IP 文本：等宽；过长（如超长 IPv6）用省略号截断，完整值存 data-raw-ip。
   热区：仅 IP 文本（.split-ip.clickable）与其右侧放大镜（.split-ip-icon）可弹出
   「🔍 IP 详细信息」弹窗，由 bindSplitIpDetail() 事件委托精确判定，
   单元格内空白不响应，故不给整格加 cursor/高亮。
   ⚠️ 收缩热区的权威手段是 `.split-ip.clickable { width: fit-content }`（见文件上部），
   本 rule 不设 width，避免与 .ip-text 的同名规则混淆（历史上二者曾合并且互相覆盖）。 */
.split-ip {
  display: block;
  max-width: 100%;
  flex: 0 0 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

/* 仅「已拿到 IP」的文本可点击（hover 高亮与 cursor 由 .clickable 控制） */
.split-ip.clickable:hover {
  color: var(--primary-color);
  background: rgba(246, 130, 31, 0.08);
}

/* 悬停时在单元格内留出一点视觉内边距（避免高亮背景紧贴文字） */
.split-ip.clickable {
  padding: 1px 4px;
  margin: -1px -4px;
}

/* 待加载 / 检测中 / 失败态不可点击 */
.split-ip.split-pending,
.split-ip.split-error,
.split-ip.split-waiting {
  cursor: default;
  background: none;
}

/* IP 单元格行容器：IP 文本 + 放大镜图标（flex 行，图标紧随文本之后） */
.split-ip-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  /* spinner 定位的兜底锚点（直接锚点是图标自身） */
  position: relative;
}

/* 放大镜图标：独立命中元素（位于 IP 文本之后，可单独点击）。
   复用与 .ip-text.clickable::after 同款内联 SVG；悬停仅放大图标、不变色底。
   position:relative 使其成为查询中 spinner 的 absolute 定位锚点。 */
.split-ip-icon {
  display: none;
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-size: 13px 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232196F3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  opacity: 0.9;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* 仅在「已拿到 IP」时显示（由 setSplitRowIp 同步增删） */
.split-ip-icon.is-visible {
  display: inline-block;
}

.split-ip-icon:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* 查询中的 spinner：绝对定位覆盖在放大镜图标正上方（不参与布局，避免挤动文本）。
   ⚠️ JS 必须把 spinner 挂到 .split-ip-icon 内部，否则会锚定到 .split-ip-wrap 而水平偏移。 */
.split-ip-wrap .split-ip-icon .loading-spinner {
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -6.5px;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 2px solid rgba(33, 150, 243, 0.25);
  border-top-color: #2196f3;
  border-radius: 50%;
  animation: ipIconSpin 0.9s linear infinite;
  pointer-events: none;
}

[data-theme="dark"] .split-ip-wrap .split-ip-icon .loading-spinner {
  border-color: rgba(144, 202, 249, 0.25);
  border-top-color: #90caf9;
}

/* 查询中：隐藏图标背景（保留 13px 占位宽度），由 spinner 顶替其视觉位置 */
.split-ip-wrap:has(.loading-spinner) .split-ip-icon {
  background-image: none;
}

/* 国家单元格：国旗 + 国家代码（如 SG） */
.split-country {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.split-flag {
  display: block;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.split-country-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0.02em;
  flex: none;
}

/* 归属地列：城市 · 省/州（主）+ ISP（小字紧随其后），单行；过长省略号截断 */
.split-geo {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.4;
  color: var(--text-color);
}

/* 城市 · 省/州：主信息，加粗；过长省略 */
.split-geo-place {
  font-weight: 600;
  color: var(--text-color);
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

/* 附属小字（国家名 / ISP / ASN 组织）：跟在主内容右侧，弱化、不换行。
   padding-left 兜底：父级 inline-flex 的 gap 在内容超宽被压缩时会视觉消失 */
.split-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-color-secondary);
  white-space: nowrap;
  padding-left: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}

/* ASN 单元格：AS 编号（主）+ 组织名（小字紧随其后）；过长省略 */
.split-asn {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.4;
}

.split-asn-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0.02em;
  flex: none;
}

.split-asn-org {
  font-size: 0.75rem;
  color: var(--text-color-secondary);
  word-break: break-word;
}

/* 待加载（未滚入视口，尚未发请求） / 检测中 / 失败 态 */
.split-waiting {
  color: var(--text-color-secondary) !important;
  opacity: 0.5;
}

.split-pending {
  color: var(--text-color-secondary) !important;
  opacity: 0.7;
}

.split-error {
  color: var(--destructive) !important;
}

/* 窄屏：收窄内边距（表格整体横向滚动由 .split-table-wrap 承接） */
@media (max-width: 640px) {
  .split-table th,
  .split-table td {
    padding: var(--space-2) var(--space-3);
  }

  .split-site-name {
    font-size: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

/* 平板（≤1200px）：网格 4 列 -> 2 列
   说明：列数变化不改变宽度约束——两条断点均使用 minmax(0, 1fr)，
   配合 .network-card/.network-info-content/.network-card-title/.title-text 的 min-width: 0，
   卡片宽度始终由轨道决定，脱敏态 / 真实态宽度恒等（IP 与地址超长部分由省略号消化）。 */
@media (max-width: 1200px) {
  .network-cards-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

/* 平板 / 窄屏（≤1199px）：导航项加图标后总宽约增 200px，副标语必须更早让位，
   否则 769–1199px 区间会出现横向挤压 / 溢出。这里同时略收内边距（10→8px），
   消除 769–~860px 的挤压溢出。盒间间距与桌面端一致（--space-1），保持同一视觉节奏。 */
@media (max-width: 1199px) {
  .brand-tagline {
    display: none;
  }

  .nav-links {
    gap: var(--space-1);
  }

  .nav-link {
    padding: 0 8px;
  }
}

/* 移动端（≤768px）：单列布局 + 「顶部精简栏 + 底部标签栏」双段式导航 + 推广板块纵向堆叠 */
@media (max-width: 768px) {
  :root {
    /* 移动端高度单一真值来源：值定义在 :root 的 --nav-height-mobile（52px），
       此处只做引用，避免同一数值出现两处硬编码；scroll-margin-top 随之自动更新 */
    --nav-height: var(--nav-height-mobile);
  }

  /* 顶部精简栏：.nav-links 脱离文档流后，品牌与主题按钮两端对齐 */
  .top-nav {
    justify-content: space-between;
    padding: 0 var(--space-4);
    gap: var(--space-3);
  }

  .nav-brand {
    font-size: 0.95rem;
  }

  #theme-switcher {
    width: 36px;
    height: 36px;
  }

  #theme-switcher svg {
    width: 20px;
    height: 20px;
  }

  /* 底部标签栏：5 等分，单格 375/5 = 75px（320px 屏仍有 64px） */
  .nav-links {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 880;              /* 必须 < IP 详情弹窗 2000、评分气泡 10001 */
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;      /* 覆盖基态 align-items:center，让 5 格各自撑满 56px 高 */
    gap: 0;                    /* 热区相连，不留死区 */
    margin-left: 0;            /* 关键：fixed 后 margin-left:auto 失效，必须归零 */
    overflow: visible;
    height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
      env(safe-area-inset-left, 0px);
    background: var(--nav-tab-bg);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    /* 顶部发丝线用 inset 阴影而非 border-top：全局 box-sizing:border-box 下 border-top
       会吃掉内容高 1px（56→55）；改用 inset 阴影后内容高精确 56px，5 格热区回到设计稿
       的 75×56，整条栏体仍为 56px，body 底部留白无需再改。 */
    box-shadow:
      inset 0 1px 0 var(--nav-border),
      0 -6px 20px -8px rgba(0, 0, 0, 0.18);
  }

  /* 单格：图标 + 文字纵排，热区 75×56 */
  .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    min-height: 0;                     /* 覆盖桌面端的 44px，由标签栏高度接管 */
    border-radius: 0;
    color: var(--nav-ink);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
  }

  .nav-link-icon {
    width: 40px; height: 26px;         /* 图标胶囊底 */
    border-radius: 13px;
    justify-content: center;           /* .nav-link-icon 基态已设 display:inline-flex */
    transition: background-color var(--transition-base);
  }

  .nav-link-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
  }

  .nav-link.active {
    color: var(--nav-ink-active);
  }

  .nav-link.active .nav-link-icon {
    background: var(--nav-tab-tint);   /* 激活态 = 图标胶囊底（设计稿默认） */
  }

  .nav-link::after {
    display: none;                     /* 桌面下划线指示器在标签栏内不适用 */
  }

  .nav-link:active {
    background: var(--nav-tab-press);
    border-radius: 12px;
  }

  .nav-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -3px;
    border-radius: 12px;
  }

  .nav-link-label {
    white-space: nowrap;
  }

  /* 内容与页脚为标签栏让位，避免底部被遮挡 */
  body {
    padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
  }

  /* 推广板块：纵向堆叠，按钮全宽 */
  .promo-banner {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
  }

  .promo-content {
    align-items: flex-start;
  }

  .promo-cta {
    width: 100%;
    justify-content: center;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .section-subtitle {
    margin-top: 0;
    font-size: 0.85rem;
  }

  .container {
    padding: var(--space-5) var(--space-4);
  }

  /* 网络 / 延迟卡片网格塌缩为单列 */
  .network-cards-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .network-card {
    padding: 0.875rem;
  }

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

  /* API 列表：移动端纵向堆叠 */
  .api-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .api-url {
    flex-basis: auto;
    width: 100%;
  }

  .copy-btn-sm {
    margin-left: 0;
  }

  /* 优选域名页：页头收紧、主卡压缩、复制行折行（域名占满整行，骰子+复制按钮同行） */
  .page-hero {
    padding: var(--space-5) var(--space-4);
  }

  .page-hero h2 {
    font-size: 1.45rem;
  }

  .primary-card {
    padding: var(--space-4);
  }

  .domain-copy-row {
    flex-wrap: wrap;
  }

  .domain-hit {
    flex-basis: 100%;
  }

  .randomize-btn {
    width: 40px;
    height: 40px;
  }

  .copy-affordance {
    flex: 1;
    justify-content: center;
  }

  /* IP 详情弹窗（移动端） */
  .ip-detail-content {
    width: 100%;
  }

  .ip-detail-head {
    padding: 15px 16px 14px;
  }

  /* 主体内边距：原 .ip-detail-body 的移动端 padding 下沉至 .ip-detail-columns */
  .ip-detail-columns {
    padding: 14px 16px 18px;
  }

  /* 窄视口双栏塌缩为单栏。
     栏容器 display:contents 退化为透传（不生成盒子），各 section 直接成为
     .ip-detail-columns 的网格项，再按 ip-sec-* 标识类的 order 重排为阅读顺序：
     安全(1) → 位置(2) → 运营商(3) → ASN(4) → 滥用举报(5，最后)。
     「基本信息」已上移头部，不再参与重排。
     桌面端 order 对块级布局无效，双栏不受影响。
     某个 section 缺失（如无 abuse/asn）时 order 序列自动收紧，无需特殊处理。 */
  .ip-detail-columns {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .ip-detail-column {
    display: contents;
  }

  .ip-sec-security { order: 1; }
  .ip-sec-location { order: 2; }
  .ip-sec-company  { order: 3; }
  .ip-sec-asn      { order: 4; }
  .ip-sec-abuse    { order: 5; }

  /* 移动端地图略矮，减少长弹窗占屏 */
  .ip-detail-map {
    height: 200px;
  }

  /* 单栏时位置字段塌回单列，避免窄屏双列挤压 */
  .ip-sec-grid2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .ip-sec-grid2 .ip-detail-item {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .ip-sec-grid2 .ip-detail-value {
    text-align: right;
  }

  .ip-sec-grid2 .ip-detail-item:nth-child(n+2) {
    border-top: 1px solid var(--hairline);
  }

  /* 移动端隐藏滚动条或使用默认样式 */
  .ip-detail-content::-webkit-scrollbar {
    width: 6px;
  }

  .ip-detail-content::-webkit-scrollbar-thumb {
    border-width: 2px;
  }

  .risk-list {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   网络状态页「移动端一屏」响应式体系（v2 紧凑矩阵）
   来源：design/network-mobile-onescreen-prototype.html 集成，日期 2026-10-03
   本段为纯追加段：不修改、不删除上方任何既有规则；全部规则追加在文件末尾，
   同特异性下天然覆盖更早的既有断点（如 ≤1200px 的 2 列延迟卡 → 平板 4 列瘦卡）。
   段内结构：基态 → 纵向弹性链路 → 桌面保险丝 → 平板收紧 → 平板瘦卡
             → 紧凑矩阵主块 → 列数分配 → 高度充裕档 → 移动收紧档 → 极矮形态
   ========================================================================== */

/* --------------------------------------------------------------------------
   一、新增组件基态：延迟分区行（紧凑形态显示，桌面隐藏）+ 地域图例 + 副标题简版
   -------------------------------------------------------------------------- */

.latency-head {
  display: none;
}

.latency-head-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-color);
  white-space: nowrap;
}

.lat-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lat-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-color-secondary);
  white-space: nowrap;
}

.lat-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 图例色与延迟卡左缘色条呼应：国内绿 / 国际蓝 */
.lat-legend-dot.domestic {
  background: #10b981;
}

.lat-legend-dot.international {
  background: #3b82f6;
}

/* 墙外测试副标题简版（X / 谷歌）：桌面隐藏，紧凑矩阵内启用 */
.subtitle-compact {
  display: none;
}

/* --------------------------------------------------------------------------
   二、纵向弹性链路（一屏地基）：body → .container → .page → .port-info
   全链路 flex column；追加式写法，.container 的 max-width:1280px 等既有值不动
   -------------------------------------------------------------------------- */

.container {
  display: flex;
  flex-direction: column;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 显式声明：防 [hidden] 页签显隐被 flex 布局击穿 */
.page[hidden] {
  display: none;
}

.port-info {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   三、桌面高度保险丝（≥1200px）：只收间距密度不换范式（1920×1080 不受影响）
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) and (max-height: 910px) {
  /* 推广条单行 */
  .promo-banner {
    padding: 10px var(--space-4);
    margin-bottom: var(--space-4);
  }

  .promo-desc {
    display: none;
  }

  .promo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .port-info {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .network-cards-container {
    margin-top: var(--space-3);
    gap: var(--space-3);
  }

  .network-card {
    padding: 10px;
  }

  .latency-cards {
    margin-top: var(--space-3);
    gap: var(--space-3);
  }

  .footer {
    padding: 13px var(--space-4);
  }
}

@media (min-width: 1200px) and (max-height: 800px) {
  .section-title {
    font-size: 1.15rem;
  }

  .section-subtitle {
    font-size: 12px;
  }

  .latency-card {
    min-height: 60px;
  }

  .latency-status {
    font-size: 1.35rem;
  }

  .network-info-content {
    padding: 0.35rem 0.5rem;
    gap: 0.25rem;
  }

  .footer-note {
    display: none;
  }
}

@media (min-width: 1200px) and (max-height: 740px) {
  .network-tip {
    display: none;
  }

  .network-card-title {
    margin-bottom: 5px;
    padding-bottom: 4px;
  }
}

/* --------------------------------------------------------------------------
   四、平板轻收紧（769–1199px 且高度 ≤820px）
   -------------------------------------------------------------------------- */

@media (min-width: 769px) and (max-width: 1199px) and (max-height: 820px) {
  .promo-desc {
    display: none;
  }

  .promo-banner {
    padding: 10px var(--space-4);
    margin-bottom: var(--space-4);
  }

  .port-info {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .footer-note {
    display: none;
  }

  .footer {
    padding: 13px var(--space-4);
  }
}

/* --------------------------------------------------------------------------
   五、平板常规（769–1199px）：延迟卡由既有 ≤1200px 断点的 2 列改为 4 列瘦卡
   -------------------------------------------------------------------------- */

@media (min-width: 769px) and (max-width: 1199px) {
  .latency-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .latency-card {
    padding: 0.6rem 0.8rem;
    min-height: 64px;
  }

  .latency-card-icon-wrapper {
    width: 30px;
    height: 30px;
  }

  .latency-card-icon-wrapper svg {
    width: 20px;
    height: 20px;
  }

  .latency-card-name {
    font-size: 0.9rem;
  }

  .latency-status {
    font-size: 1.3rem;
  }
}

/* --------------------------------------------------------------------------
   六、紧凑矩阵主块（本稿核心）
   生效范围：≤768 移动，或 769–1199 且高度 ≤780（横屏手机 / 矮平板）
   —— 出口卡改 3 行紧凑卡；延迟卡改地域色条芯片；说明文案隐藏
   -------------------------------------------------------------------------- */

@media (max-width: 768px),
  (min-width: 769px) and (max-width: 1199px) and (max-height: 780px) {

  /* 适配差异：对齐设计稿移动导航块的容器内距（12px 12px 10px），
     线上基线 var(--space-5) var(--space-4)（24px/16px）会吃掉一屏余量 */
  .container {
    padding: 12px 12px 10px;
  }

  .section-subtitle {
    display: none;
  }

  /* 适配差异：线上 .section-title 带渐变短线体系（margin/padding/border），
     设计稿移动形态标题无下缘装饰，归零以保一屏余量 */
  .section-title {
    font-size: 1.05rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
  }

  /* 连带归零：border 归零后残留的渐变短线（bottom:-1px）会悬空叠压标题文字底部 */
  .section-title::after {
    display: none;
  }

  /* 推广条单行化 */
  .promo-banner {
    padding: 7px 12px;
    margin-bottom: 12px;
    gap: 10px;
    /* P1 修补：覆盖线上 ≤768 块的纵向堆叠，回到设计稿单行形态（省 ~41px） */
    flex-direction: row;
    align-items: center;
  }

  .promo-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
    border-radius: 8px;
    /* 适配差异：线上基线带 1px border，设计稿移动形态无描边 */
    border: 0;
  }

  .promo-title {
    font-size: 13px;
  }

  .promo-desc {
    display: none;
  }

  .promo-cta {
    padding: 6px 12px;
    font-size: 12px;
    /* P1 修补：回收线上 ≤768 块的全宽按钮（width:100%），单行内右置不参与换行 */
    width: auto;
    flex-shrink: 0;
  }

  .promo-cta svg {
    width: 14px;
    height: 14px;
  }

  .port-info {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  /* —— 出口紧凑卡 —— */
  .network-cards-container {
    margin-top: 8px;
    gap: 8px;
  }

  .network-card {
    padding: 9px 10px;
    border-width: 1px;
    border-radius: 10px;
  }

  /* 国旗角标随卡片缩小 */
  .network-card.has-flag-badge::after {
    width: 64px;
    height: 42px;
    bottom: -9px;
    right: -2px;
  }

  .network-card-title {
    margin-bottom: 5px;
    padding-bottom: 0;
    border-bottom: 0;
    gap: 6px;
    align-items: center;
  }

  .status-indicator {
    width: 8px;
    height: 8px;
  }

  .title-text {
    flex-wrap: nowrap;
    align-items: baseline;
  }

  .title-main {
    font-size: 13px;
    flex-shrink: 0;
  }

  .title-subtitle {
    font-size: 11px;
    line-height: 1.3;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* 副标题双版本：紧凑形态换简版开关「X / 谷歌」（热区 ≥24px 由 padding 补足） */
  .subtitle-full {
    display: none;
  }

  .subtitle-compact {
    display: inline-flex;
    align-items: baseline;
    min-width: 0;
  }

  .subtitle-compact .cf-subtitle-switch {
    padding: 2px 1px;
  }

  .network-info-content {
    padding: 0;
    gap: 3px;
  }

  .ip-text {
    font-size: 13px;
    line-height: 1.45;
  }

  /* 放大镜图标随 IP 字号缩小 */
  .ip-text.clickable::after {
    width: 11px;
    height: 11px;
    background-size: 11px 11px;
    margin-left: 5px;
  }

  .location-text {
    font-size: 11px;
    line-height: 1.4;
  }

  .country-text {
    font-size: 11px;
  }

  .network-tip {
    display: none;
  }

  /* —— 延迟分区行 + 地域图例（基态隐藏，紧凑形态显示） —— */
  .latency-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
    min-width: 0;
  }

  /* —— 延迟芯片：地域信息由左缘 3px 色条承载，与图例呼应 —— */
  .latency-cards {
    margin-top: 6px;
    gap: 7px;
  }

  .latency-card {
    padding: 6px 7px 6px 9px;
    border-radius: 10px;
    border-width: 1px;
    border-left: 3px solid var(--border-color);
    min-height: 0;
    box-shadow: none;
    display: block;
    /* P1-1：grid item 归零最小宽度，防 nowrap 文本顶开轨道 */
    min-width: 0;
  }

  .latency-card:has(.latency-card-region-domestic) {
    border-left-color: #10b981;
  }

  .latency-card:has(.latency-card-region-international) {
    border-left-color: #3b82f6;
  }

  .latency-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }

  .latency-card-info {
    gap: 4px;
    /* P1-1：flex 链允许收缩，名称/状态的省略号才能生效 */
    min-width: 0;
  }

  .latency-card-icon-wrapper {
    width: 15px;
    height: 15px;
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .latency-card-icon-wrapper svg {
    width: 14px;
    height: 14px;
  }

  .latency-card-text {
    gap: 4px;
    flex: 1 1 auto;
    /* P1-1：文字列允许收缩（flex 链归零最小宽度） */
    min-width: 0;
  }

  .latency-card-name {
    font-size: 10.5px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: none;
    /* P1-1：nowrap 防止名称列被挤窄后逐字竖排换行（回归证据：name 23.7×80px） */
    white-space: nowrap;
    /* P1 修补：行高 1.2 收紧芯片纵向（继承 1.6 时单行占 16.8px） */
    line-height: 1.2;
  }

  /* 地域徽章隐藏：信息由左缘色条 + 分区行图例承载 */
  .latency-card-region {
    display: none;
  }

  .latency-status {
    /* 适配差异：线上基线为 position:absolute（right:0 top:50% 垂直居中），
       在纵排芯片内会与名称行重叠，必须还原为流内元素后右对齐 */
    position: static;
    right: auto;
    top: auto;
    transform: none;
    margin-left: 0;
    font-size: 15px;
    text-align: right;
    text-shadow: none;
    /* P1-1：状态文本（如 TIMEOUT，实测 81.3px）同样 nowrap+省略，不参与挤压换行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* P1 修补：行高 1.2 收紧芯片纵向（继承 1.6 时 15px 占 24px） */
    line-height: 1.2;
  }

  .latency-status .unit {
    font-size: 9px;
  }

  /* 心电背景装饰仅桌面渲染 */
  .latency-graph-container {
    display: none;
  }

  /* 页脚单行省略 */
  .footer {
    padding: 11px 12px;
    font-size: 11px;
  }

  /* 适配差异：线上 .footer p 自带 0.9rem 字号，改回继承才能吃到 11px 档 */
  .footer p {
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .footer-note {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   七、紧凑矩阵列数分配：移动 2×2 出口 + 4×2 芯片；矮平板 4 列出口 + 4×2 芯片
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .network-cards-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 769px) and (max-width: 1199px) and (max-height: 780px) {
  .network-cards-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

/* --------------------------------------------------------------------------
   八、高度充裕档（≤768 且 ≥820h）：延迟 4×2 芯片升格为 2 列 × 4 行迷你横卡
   （390×844 / 430×932 / 640×960 / 768×1024 等；高度不足自动回落 4×2 芯片）
   -------------------------------------------------------------------------- */

@media (max-width: 768px) and (min-height: 820px) {
  .latency-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .latency-card {
    padding: 9px 10px 9px 12px;
    border-radius: 11px;
    min-height: 54px;
    display: flex;
    align-items: center;
  }

  .latency-card-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .latency-card-info {
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .latency-card-icon-wrapper {
    width: 24px;
    height: 24px;
  }

  .latency-card-icon-wrapper svg {
    width: 20px;
    height: 20px;
  }

  .latency-card-name {
    font-size: 12.5px;
  }

  .latency-status {
    margin-left: auto;
    font-size: 17px;
  }

  .latency-status .unit {
    font-size: 10px;
  }
}

/* --------------------------------------------------------------------------
   九、移动收紧档（≤768 且 ≤640h）：出口卡降 2 行制（IP·归属同行）
   （覆盖 320×568 / 360×640）
   -------------------------------------------------------------------------- */

@media (max-width: 768px) and (max-height: 640px) {
  .container {
    padding: 8px 10px 8px;
  }

  .promo-banner {
    margin-bottom: 8px;
  }

  .port-info {
    padding: 9px;
    margin-bottom: 8px;
  }

  .section-title {
    font-size: 1rem;
  }

  .network-cards-container {
    margin-top: 5px;
    gap: 6px;
  }

  .network-card {
    padding: 8px 9px;
  }

  .title-main {
    font-size: 12px;
  }

  .country-text {
    font-size: 10.5px;
  }

  /* IP · 归属 同行（2 行制卡） */
  .network-info-content {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 8px;
  }

  .ip-text {
    font-size: 12px;
    flex: 0 1 auto;
    width: auto;
    /* P3-1：IP 列配额 62% -> 70%，保证 ≈10 字符可读 */
    max-width: 70%;
  }

  .location-text {
    /* P3-1：归属列 shrink 2，压缩时优先让位给 IP 列 */
    flex: 1 2 auto;
    width: auto;
    justify-content: flex-end;
    font-size: 10.5px;
  }

  .latency-head {
    margin-top: 9px;
  }

  .latency-cards {
    gap: 5px;
  }

  .latency-status {
    font-size: 13px;
  }

  .footer {
    padding: 8px 10px;
  }
}

/* --------------------------------------------------------------------------
   十、极矮形态（竖屏 ≤540h / 横屏平板 ≤560h）
   出口卡 2 行制：IP·归属合并同行；延迟芯片单行制
   （覆盖 320×480 / 844×390 横屏等）
   -------------------------------------------------------------------------- */

@media
  ((max-width: 768px) and (max-height: 540px)),
  ((min-width: 769px) and (max-width: 1199px) and (max-height: 560px)) {

  .container {
    padding: 8px 10px 8px;
  }

  .promo-banner {
    padding: 6px 10px;
    margin-bottom: 8px;
  }

  .promo-icon {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .promo-title {
    font-size: 12px;
  }

  .port-info {
    padding: 9px;
    margin-bottom: 8px;
  }

  .section-title {
    font-size: 0.95rem;
  }

  .network-cards-container {
    margin-top: 5px;
    gap: 6px;
  }

  .network-card {
    padding: 7px 8px;
    border-radius: 9px;
  }

  .network-card-title {
    margin-bottom: 3px;
  }

  .title-main {
    font-size: 12px;
  }

  /* IP · 归属 同行 */
  .network-info-content {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 8px;
  }

  .ip-text {
    font-size: 12px;
    flex: 0 1 auto;
    width: auto;
    /* P3-1：IP 列配额 62% -> 70%，保证 ≈10 字符可读 */
    max-width: 70%;
  }

  .location-text {
    /* P3-1：归属列 shrink 2，压缩时优先让位给 IP 列 */
    flex: 1 2 auto;
    width: auto;
    justify-content: flex-end;
    font-size: 10.5px;
  }

  .country-text {
    font-size: 10.5px;
  }

  /* 芯片单行制：图标+名称 | 数值 压成一行 */
  .latency-head {
    margin-top: 8px;
  }

  .latency-cards {
    margin-top: 4px;
    gap: 6px;
  }

  .latency-card {
    padding: 4px 7px 4px 9px;
  }

  .latency-card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .latency-status {
    font-size: 12.5px;
  }

  .latency-status .unit {
    font-size: 8px;
  }

  .footer {
    padding: 7px 10px;
    font-size: 10px;
  }
}

/* 横屏平板极矮：芯片 8 列单行（1024/8 ≈ 128px 一格） */
@media (min-width: 769px) and (max-width: 1199px) and (max-height: 560px) {
  .latency-cards {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  /* P1-2：8 列格宽 ≈92px，文字列必须有明确 flex 分配，否则名称被状态文本挤没 */
  .latency-card-icon-wrapper {
    flex: 0 0 auto;
  }

  .latency-card-text {
    flex: 1 1 auto;
    min-width: 0;
    /* icon(15px)+gap 预留由 44px 收窄到 36px，让名称列多拿 8px */
    max-width: calc(100% - 36px);
  }

  /* 名称保底 2 字符可见（省略号形式）；状态文本承担剩余压缩并截断 */
  .latency-card-name {
    min-width: 20px;
  }

  .latency-status {
    flex: 0 1 auto;
    min-width: 0;
  }
}
