/* ISPing.me — 新版 UI 样式（2026-10-05 定稿）
   主题：跟随系统 + 手动切换浅色/深色 */

/* ================= 主题变量 ================= */
:root,
:root[data-theme="light"] {
  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  --bg-grad: radial-gradient(circle at 8% 0%, #d8eaff 0, transparent 30%),
    linear-gradient(180deg, #f4f8ff 0, #edf4fd 100%);
  --text: #12213a;
  --muted: #71809a;
  --link: #0877ee;
  --blue: #1677ff;
  --card: rgba(255, 255, 255, 0.84);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --hero-bg: linear-gradient(135deg, rgba(255,255,255,.9), rgba(222,236,255,.78));
  --box-bg: rgba(255, 255, 255, 0.55);
  --type-bg: #fff8ed;
  --type-border: #e2e8f1;
  --search-bg: rgba(255, 255, 255, 0.9);
  --input-border: #dbe6f4;
  --iconbtn-bg: #ffffff;
  --iconbtn-border: #dfe8f5;
  --iconbtn-color: #5b6b86;
  --row-border: #e7edf5;
  --border: #e2e8f2;
  --input-bg: #ffffff;
  --btn-bg: #1478f7;
  --tooltip-bg: #ffffff;
  --pill-green-bg: #1f9d61;
  --pill-green-text: #ffffff;
  --pill-gray-bg: #e8edf4;
  --pill-gray-text: #66788f;
  --shadow: 0 18px 50px rgba(65,105,160,.13), 0 2px 8px rgba(65,105,160,.07);
  --bar-bg: #e5ebf4;
  --toast-bg: #12213a;
  --toast-text: #ffffff;
}

:root[data-theme="dark"] {
  --bg-grad: radial-gradient(circle at 8% 0%, #16233d 0, transparent 32%),
    linear-gradient(180deg, #0d1219 0, #101724 100%);
  --text: #e8edf5;
  --muted: #93a1b5;
  --link: #5b9dff;
  --blue: #5b9dff;
  --card: rgba(20, 27, 38, 0.86);
  --nav-bg: rgba(20, 27, 38, 0.75);
  --hero-bg: linear-gradient(135deg, rgba(32,42,62,.92), rgba(22,30,48,.8));
  --box-bg: rgba(255, 255, 255, 0.05);
  --type-bg: rgba(255, 159, 10, 0.07);
  --type-border: #2a3852;
  --search-bg: rgba(255, 255, 255, 0.06);
  --input-border: #2a3852;
  --iconbtn-bg: #1b2432;
  --iconbtn-border: #2a3852;
  --iconbtn-color: #93a1b5;
  --row-border: #232e40;
  --border: #232e40;
  --input-bg: #1b2432;
  --btn-bg: #2f7de1;
  --tooltip-bg: #1b2432;
  --pill-gray-bg: #232e40;
  --pill-gray-text: #93a1b5;
  --shadow: 0 18px 50px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  --bar-bg: #232e40;
  --toast-bg: #e8edf5;
  --toast-text: #0d1219;
}

/* 跟随系统：未手动选择时交给媒体查询 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg-grad: radial-gradient(circle at 8% 0%, #16233d 0, transparent 32%),
      linear-gradient(180deg, #0d1219 0, #101724 100%);
    --text: #e8edf5;
    --muted: #93a1b5;
    --link: #5b9dff;
    --blue: #5b9dff;
    --card: rgba(20, 27, 38, 0.86);
    --nav-bg: rgba(20, 27, 38, 0.75);
    --hero-bg: linear-gradient(135deg, rgba(32,42,62,.92), rgba(22,30,48,.8));
    --box-bg: rgba(255, 255, 255, 0.05);
    --type-bg: rgba(255, 159, 10, 0.07);
    --type-border: #2a3852;
    --search-bg: rgba(255, 255, 255, 0.06);
    --input-border: #2a3852;
    --iconbtn-bg: #1b2432;
    --iconbtn-border: #2a3852;
    --iconbtn-color: #93a1b5;
    --row-border: #232e40;
    --border: #232e40;
    --input-bg: #1b2432;
    --btn-bg: #2f7de1;
    --tooltip-bg: #1b2432;
    --pill-gray-bg: #232e40;
    --pill-gray-text: #93a1b5;
    --shadow: 0 18px 50px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
    --bar-bg: #232e40;
    --toast-bg: #e8edf5;
    --toast-text: #0d1219;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-stack);
  color: var(--text);
  background: var(--bg-grad);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.wrap { width: min(880px, calc(100% - 32px)); margin: auto; }

/* ================= 导航 ================= */
.nav {
  height: 62px;
  margin: 12px auto 14px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid rgba(255,255,255,.9);
  background: var(--nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(70,110,160,.1);
}
:root[data-theme="dark"] .nav { border-color: rgba(255,255,255,.08); }
.brand {
  display: flex;
  align-items: center;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.logo {
  width: 37px; height: 37px;
  color: var(--text);
  display: grid;
  place-items: center;
  margin-right: 6px;
  flex-shrink: 0;
}
.logo svg { width: 35px; height: 35px; }
.sep { height: 25px; width: 1px; background: var(--border); margin: 0 20px; flex-shrink: 0; }
.links { display: flex; gap: 8px; align-items: center; }
.links a {
  padding: 10px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border-radius: 13px;
  white-space: nowrap;
  transition: transform .16s ease-out, background-color .2s ease;
  will-change: transform;
}
.links a:not(.active):hover { background: rgba(120,150,190,.14); }
:root[data-theme="dark"] .links a:not(.active):hover { background: rgba(140,170,220,.12); }
@media (prefers-reduced-motion: reduce) { .links a { transition: none; } }
.links a.active { background: #e7f0ff; color: #0875ef; }
:root[data-theme="dark"] .links a.active { background: rgba(91,157,255,.16); color: #5b9dff; }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.pill {
  height: 38px;
  border: 1px solid var(--iconbtn-border);
  background: var(--search-bg);
  border-radius: 20px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-stack);
  cursor: pointer;
}
.pill svg { width: 16px; height: 16px; }
/* 主题按钮：macOS 控制中心风格圆形按钮 */
.pill.theme-btn {
  border-radius: 50%;
  width: 38px; height: 38px;
  padding: 0; justify-content: center;
  background: linear-gradient(180deg, #ffffff, #edf1f7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 8px rgba(60,90,140,.14);
  transition: transform .15s ease;
}
:root[data-theme="dark"] .pill.theme-btn {
  background: linear-gradient(180deg, #2b3546, #1a2230);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 8px rgba(0,0,0,.4);
}
.pill.theme-btn:active { transform: scale(.88); }
.pill.theme-btn svg { width: 19px; height: 19px; display: block; }

/* ================= 搜索区 ================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 30px 20px;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 24px;
  background: var(--hero-bg);
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .hero { border-color: rgba(255,255,255,.07); }
.hero:after {
  content: "";
  position: absolute;
  right: 15px; top: -40px;
  width: 290px; height: 230px;
  background: radial-gradient(circle at center, #8dc4ff66, transparent 64%);
  pointer-events: none;
}
.eyebrow { font-size: 11px; letter-spacing: 2px; color: #478cf0; font-weight: 700; }
.hero h1 { font-size: 38px; margin: 8px 0 5px; letter-spacing: -1.5px; }
.hero p { margin: 0 0 25px; color: var(--muted); font-size: 15px; }
.search {
  height: 60px;
  border-radius: 17px;
  background: var(--search-bg);
  border: 1px solid var(--input-border);
  box-shadow: 0 5px 18px rgba(73,119,183,.08);
  display: flex;
  align-items: center;
  padding: 6px;
}
.search .icon { font-size: 27px; color: #637795; padding: 0 15px; }
.search input {
  border: 0; outline: 0; flex: 1;
  font-size: 16px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-stack);
  min-width: 0;
}
.search button {
  height: 48px;
  padding: 0 29px;
  border: 0;
  border-radius: 14px;
  background: var(--btn-bg);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 7px 18px #1677ff42;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-stack);
}
.search button:disabled { opacity: .65; cursor: default; }

/* ================= 结果卡片 ================= */
.card {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
:root[data-theme="dark"] .card { border-color: rgba(255,255,255,.07); }

.topinfo {
  padding: 16px 16px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

/* IP 地址栏 */
.ipbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--iconbtn-border);
  border-radius: 17px;
  background: var(--box-bg);
  min-width: 0;
}
.ipbar .flag { font-size: 30px; line-height: 1; margin-right: 8px; display: inline-flex; align-items: center; align-self: center; }
.ip {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.5px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  white-space: nowrap;
  min-width: 0; /* 允许在 flex 容器中收缩，配合 JS 字号自适应 */
  overflow: hidden; /* 收缩瞬间不与右侧按钮重叠 */
}
.iconbtn {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--iconbtn-border);
  background: var(--iconbtn-bg);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--iconbtn-color);
  font-family: var(--font-stack);
  flex-shrink: 0;
}
.iconbtn:hover { border-color: var(--blue); color: var(--blue); }
.iconbtn svg { width: 17px; height: 17px; }
.ipbar .iconbtn { width: 26px; height: 26px; }
.ipbar .iconbtn svg { width: 15px; height: 15px; }
.iconbtn.sm { width: 26px; height: 26px; }
.iconbtn.sm svg { width: 15px; height: 15px; }
.v6 {
  font-size: 11px;
  color: var(--link);
  border: 1px solid #bcd9ff;
  background: #f0f7ff;
  border-radius: 10px;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
:root[data-theme="dark"] .v6 { border-color: #2f4a75; background: rgba(91,157,255,.12); }

/* IP 类型 */
.type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 19px 20px 14px;
  border: 1px solid var(--type-border);
  border-radius: 17px;
  background: var(--type-bg);
}
.type .tb-label { font-size: 14px; color: var(--text); white-space: nowrap; }
.type .badges { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.type .faq { font-size: 12px; color: var(--link); text-decoration: none; white-space: nowrap; }

/* 大徽章（IP 类型区） */
.pill-bw-dc, .pill-bw-home, .pill-type-unk, .pill-native-lg, .pill-bcast-lg {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-block;
}
.pill-bw-dc { background: linear-gradient(135deg, #ff9f0a, #ff6b35); box-shadow: 0 4px 10px #ff6b3530; }
.pill-bw-home, .pill-native-lg { background: #1f9d61; box-shadow: 0 4px 10px #18b76a30; }
.pill-type-unk { background: linear-gradient(135deg, #9aa0a6, #7b8188); box-shadow: 0 4px 10px #7b818830; }
.pill-bcast-lg { background: linear-gradient(135deg, #f6cfa8, #e8a558); color: #7a4a12; box-shadow: 0 4px 10px #e8a55830; }

/* 小徽章（行内） */
.pill-idx-idc, .pill-idx-isp, .pill-idx-bus, .pill-idx-unk,
.pill-gray, .pill-mobile {
  display: inline-block;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 750;
  color: #fff;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
  box-sizing: border-box;
}
.pill-native, .pill-bcast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  white-space: nowrap;
  box-sizing: border-box;
}
.pill-idx-idc { background: linear-gradient(180deg, #ff9f0a, #f67b1f); box-shadow: 0 4px 10px #ff9f0a30; margin-right: 8px; }
.pill-idx-isp { background: linear-gradient(180deg, #25c977, #0eaa5c); box-shadow: 0 4px 10px #18b76a30; margin-right: 8px; }
.pill-idx-bus { background: linear-gradient(180deg, #b5d334, #86a81c); box-shadow: 0 4px 10px #a3c42230; margin-right: 8px; }
.pill-idx-unk { background: #9aa0a6; margin-right: 8px; }
.pill-native { background: #1f9d61; box-shadow: 0 4px 10px #18b76a30; }
.pill-bcast { background: #f6cfa8; color: #a05a1a; }
.pill-gray { background: var(--pill-gray-bg); color: var(--pill-gray-text); }
.pill-mobile { background: #7c6cf0; }

/* 启发式/注册地小标注 */
.est-tag {
  font-size: 10px;
  color: var(--muted);
  border: 1px dashed var(--muted);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: 2px;
  white-space: nowrap;
}

/* ================= 信息区 ================= */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 14px;
}
.panel {
  border: 1px solid var(--iconbtn-border);
  border-radius: 17px;
  background: var(--box-bg);
  padding: 5px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row {
  min-height: 58px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--row-border);
  min-width: 0;
  flex: 1 0 auto;
}
.row:last-child { border-bottom: 0; }
.ico {
  width: 35px; height: 35px;
  border-radius: 12px;
  background: #eaf2ff;
  color: #287cf2;
  display: grid;
  place-items: center;
  margin-right: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.ico svg { width: 19px; height: 19px; }
.label { width: 110px; font-size: 14px; flex-shrink: 0; }
.value { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
/* ASN 所有者 / 企业：长文本缩小字号并强制断行，防止撑破边框 */
#v-owner, #v-isp { font-size: 13px; word-break: break-all; }
.link { color: var(--link); text-decoration: none; }
a.link:hover { text-decoration: underline; }
.btn-outline {
  font-size: 13px;
  color: var(--link);
  border: 1.5px solid #bcd9ff;
  background: #f0f7ff;
  border-radius: 11px;
  padding: 8px 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-stack);
}
:root[data-theme="dark"] .btn-outline { border-color: #2f4a75; background: rgba(91,157,255,.12); }
.btn-outline:disabled { opacity: .6; cursor: default; }

/* 国旗图片（Windows Chrome/Edge 不渲染 flag emoji，一律用图片） */
.flag-img {
  width: 22px; height: 15px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: -2px;
  margin-right: 4px;
  box-shadow: 0 0 1px rgba(0,0,0,.35);
}
/* IP 地址栏国旗：24px 高，与 IP 文字视觉协调 */
.ipbar .flag-img { width: 34px; height: 24px; border-radius: 3px; }

/* 悬浮位置卡片 */
.loc-wrap { position: relative; display: inline-block; }
.loc-card {
  display: none;
  position: absolute;
  top: 135%;
  left: 0;
  width: 300px;
  max-width: 70vw;
  background: var(--tooltip-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  text-align: left;
  z-index: 30;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text);
}
.loc-wrap:hover .loc-card { display: block; }
.loc-card .loc-en { color: var(--muted); font-size: 12px; }
.loc-card .loc-src { color: var(--muted); font-size: 12px; }
.loc-card .conf-bar {
  display: inline-block;
  width: 34px; height: 6px;
  border-radius: 3px;
  background: var(--pill-gray-bg);
  margin-right: 5px;
  vertical-align: 1px;
}
.loc-card .conf-bar.on { background: #1f9d61; }

/* AI 检测 chips */
.ai-chips { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.ai-chip {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--pill-gray-bg);
  color: var(--muted);
  white-space: nowrap;
}
.ai-chip.ok { background: rgba(31,157,97,.14); border-color: #1f9d61; color: #1f9d61; }
.ai-chip.fail { background: rgba(229,72,77,.12); border-color: #e5484d; color: #e5484d; }
.ai-chip.wait { opacity: .7; }

/* ================= 风控 / 共享 / 数字 IP ================= */
.status {
  margin: 0 16px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.status > .statusbox { min-width: 0; }
.statusbox {
  min-height: 65px;
  border: 1px solid var(--iconbtn-border);
  border-radius: 17px;
  background: var(--box-bg);
  display: flex;
  align-items: center;
  padding: 5px 16px;
  gap: 14px;
  min-width: 0;
}
.statusbox b { white-space: nowrap; flex-shrink: 0; font-size: 14px; }
.statusbox .ico { flex-shrink: 0; margin-right: 0; }
/* 内容区左移一个 gap，与上方 .row 的值左对齐（仅进度条，徽章保持右对齐） */
.statusbox > .bar { margin-left: -14px; }
.bar {
  flex: 1 1 auto;
  min-width: 70px;
  height: 25px;
  background: var(--bar-bg);
  border-radius: 15px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 15px;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 25px;
  white-space: nowrap;
  min-width: 64px;
  transition: width .6s ease;
}
.dots { display: flex; gap: 7px; flex-shrink: 0; }
.dot { width: 13px; height: 13px; border-radius: 50%; }
.d1 { background: #34c759; } .d2 { background: #a3d426; } .d3 { background: #ffd60a; }
.d4 { background: #ff9f0a; } .d5 { background: #ff453a; }
.share {
  margin-left: auto;
  background: #f0b000;
  color: #fff;
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
/* 大模型检测通栏：chips 展开只撑高本栏，不影响上方 4+4 网格 */
.airow { margin: 0 16px 16px; flex-wrap: wrap; }
.airow .ai-body { display: flex; align-items: center; gap: 12px; flex: 1; flex-wrap: wrap; min-width: 0; }
/* IP 地址(数字)行内 */
.numval { display: flex; align-items: center; gap: 10px; }
.numval #v-num { letter-spacing: 3px; color: var(--muted); font-size: 14px; }

/* ================= 地图 ================= */
.map-card { padding: 12px 12px 14px; overflow: hidden; }
.map-title { padding: 3px 8px 11px; font-weight: 700; font-size: 15px; }
#map { height: 300px; width: 100%; z-index: 1; border-radius: 15px; background: var(--bar-bg); }
:root[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(185deg) brightness(.92) contrast(.92);
}
/* 地图定位图标（CSS 绘制，不依赖外部图片） */
.p0-pin-wrap { background: none; border: none; }
.p0-pin { width: 30px; height: 34px; position: relative; }
.p0-pin::before {
  content: "";
  position: absolute;
  left: 3px; top: 0;
  width: 24px; height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #2563eb;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.p0-pin::after {
  content: "";
  position: absolute;
  left: 11.5px; top: 8.5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
}

/* ================= 工具视图（PING / 家宽ASN / DNS） ================= */
.tool-card { padding: 30px 28px; text-align: center; }
.tool-card h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -1px; }
.tool-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.tool-cta { padding: 14px 0 4px; }
.btn-go {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 14px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 7px 18px #1677ff42;
}
.tool-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  padding: 6px 0 4px;
}
.tool-note { color: var(--muted); font-size: 12px; text-align: center; padding: 0 20px 20px; }

/* 家宽ASN查询 */
.homeasn-controls {
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.country-select-wrap { position: relative; flex: 0 0 320px; max-width: 100%; min-width: 0; }
.country-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--search-bg);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-stack);
  cursor: pointer;
}
.country-flag { display: inline-flex; align-items: center; }
.country-flag .flag-img { width: 26px; height: 18px; margin-right: 0; }
.country-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-caret { color: var(--muted); }
.country-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--tooltip-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 40;
  padding: 6px;
}
/* 下拉面板所在卡片需压住下方结果卡片：.card 的 backdrop-filter 会创建层叠上下文，
   面板的 z-index 只在卡片内部有效，不抬卡片会被后出现的兄弟卡片盖住 */
#view-homeasn > .tool-card:first-child { position: relative; z-index: 2; }
.country-panel input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-stack);
  outline: none;
  margin-bottom: 6px;
}
.country-list { max-height: 280px; overflow-y: auto; padding: 6px; }
.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.country-item:hover { background: var(--pill-gray-bg); }
.country-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.country-item-code { color: var(--muted); font-size: 12px; flex-shrink: 0; }
.country-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.homeasn-go {
  height: 48px;
  padding: 0 32px;
  border: 0;
  border-radius: 14px;
  background: var(--btn-bg);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 18px #1677ff42;
  font-family: var(--font-stack);
}
#homeasnResultTitle { display: inline-flex; align-items: center; gap: 8px; }
#homeasnBody { display: flex; flex-direction: column; align-items: center; padding: 0 20px; }
#homeasnBody .hasn-row { width: 100%; max-width: 760px; box-sizing: border-box; }
.hasn-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 14px 4px;
  border-bottom: 1px solid var(--row-border);
  text-align: left;
}
.hasn-row:last-child { border-bottom: 0; }
.hasn-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-width: 148px; padding-top: 1px; }
.hasn-num { color: var(--muted); font-size: 14px; min-width: 20px; }
.hasn-asn { font-size: 16px; font-weight: 700; white-space: nowrap; }
.hasn-copy {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 1px solid var(--iconbtn-border);
  background: var(--iconbtn-bg);
  color: var(--iconbtn-color);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.hasn-copy svg { width: 14px; height: 14px; }
.hasn-right { flex: 1; min-width: 0; }
.hasn-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.hasn-en { font-weight: 400; color: var(--muted); font-size: 13px; }
.hasn-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.homeasn-empty { padding: 20px 4px; color: var(--muted); font-size: 14px; text-align: center; }

/* ================= 页脚 / Toast ================= */
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 14px 0 24px;
  line-height: 2;
}
#appVer { opacity: .6; }
#toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 100;
  max-width: 80vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= 移动端 ================= */
@media (max-width: 760px) {
  .wrap { width: calc(100% - 18px); }
  /* 导航：缩小按钮，给链接留空间 */
  .nav { height: 56px; padding: 0 10px; }
  .sep { display: none; }
  .brand { font-size: 19px; }
  .logo { width: 32px; height: 32px; margin-right: 1px; }
  .logo svg { width: 30px; height: 30px; }
  .links { flex: 1 1 auto; min-width: 0; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .links::-webkit-scrollbar { display: none; }
  .links a { font-size: 12px; padding: 7px 9px; margin-left: 1px; }
  .links a.active { padding: 6px 8px; }
  .nav-right { gap: 6px; }
  .pill { height: 32px; padding: 0 10px; font-size: 12px; gap: 5px; }
  .pill svg { width: 14px; height: 14px; }
  .pill.theme-btn { width: 32px; height: 32px; padding: 0; font-size: 14px; }
  /* hero 压缩：少占屏，多显示查询结果 */
  .hero { padding: 16px 16px 14px; }
  .hero .eyebrow { display: none; }
  .hero h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -1px; }
  .hero p { font-size: 13px; margin: 0 0 14px; }
  .search { height: 52px; }
  .search .icon { font-size: 22px; padding: 0 10px; }
  .search input { font-size: 15px; }
  .search button { height: 40px; padding: 0 18px; font-size: 14px; }
  .grid, .status { grid-template-columns: 1fr; }
  .topinfo { grid-template-columns: 1fr; padding: 16px 16px 10px; }
  .ipbar { flex-wrap: wrap; }
  .ip { font-size: 24px; }
  .label { width: 90px; }
  .grid .panel:first-child .label { width: 90px; }
  .bar { width: 140px; max-width: 40%; }
  #map { height: 260px; }
  .tool-card { padding: 22px 16px; }
  .homeasn-controls { flex-direction: column; align-items: stretch; }
  .country-select-wrap { flex: 1 1 auto; }
}

/* Q&A 弹窗：为什么双ISP还会显示"IDC机房IP"？ */
/* 网络标记 */

.nm-info { background:none; border:none; padding:2px; margin-left:2px; color:#a0a5ad; cursor:pointer; display:inline-flex; transform:translateY(3px); }
.nm-info svg { width:16px; height:16px; display:block; }
.nm-info:hover { color:#1a8fe3; }
.nm-value { margin-left:auto; display:flex; align-items:center; }
#v-native { margin-left:auto; display:flex; align-items:center; }
.nm-badge { display:inline-flex; align-items:center; justify-content:center; width:126px; border-radius:14px; padding:6px 0; font-size:12px; font-weight:700; color:#fff; box-sizing:border-box; cursor:pointer; white-space:nowrap; flex-shrink:0; }
.nm-green { background:linear-gradient(135deg,#25c977,#12a45c); }
.nm-red { background:linear-gradient(135deg,#ff6b6b,#e84545); }
.nm-gray { background:#e8ebf0; color:#8a8f98; cursor:default; }
.nm-summary { background:#eef4ff; border-radius:12px; padding:12px 14px; margin-bottom:12px; font-size:14px; }
:root[data-theme="dark"] .nm-summary { background:rgba(26,143,227,.12); }
.nm-summary .hl { color:#1a8fe3; font-weight:700; }
.nm-summary .nm-note { color:#5a5a5e; font-size:13px; margin-top:4px; line-height:1.6; }
.nm-item { background:#f7f9fc; border-radius:12px; padding:12px 14px; margin-bottom:10px; }
:root[data-theme="dark"] .nm-item { background:rgba(255,255,255,.04); }
.nm-item .nm-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.nm-item .nm-name { font-size:15px; font-weight:700; }
.nm-item .nm-status { font-size:13px; font-weight:600; }
.nm-item .nm-status.ok { color:#1a8fe3; }
.nm-item .nm-status.hit { color:#e84545; }
.nm-item .nm-status.unk { color:#8a8f98; }
.nm-item .nm-desc { font-size:13px; color:#5a5a5e; line-height:1.6; }
.qa-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 18, 32, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.qa-overlay[hidden] { display: none; }
.qa-dialog {
  width: min(640px, 100%); max-height: 82vh;
  background: var(--card);
  border: 1px solid rgba(120, 150, 200, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column; overflow: hidden;
  animation: qa-pop 0.22s ease;
}
@keyframes qa-pop {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .qa-dialog { animation: none; }
}
.qa-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid rgba(120, 150, 200, 0.14);
  flex: none;
}
.qa-title { font-size: 16px; font-weight: 700; color: var(--text); }
.qa-close {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(120, 150, 200, 0.22);
  background: transparent; color: var(--text);
  font-size: 14px; line-height: 1; cursor: pointer;
}
.qa-close:hover { background: rgba(120, 150, 200, 0.12); }
.qa-body {
  padding: 4px 18px 18px; overflow-y: auto;
  color: var(--text); font-size: 14px; line-height: 1.75;
}
.qa-item { padding: 12px 0; border-bottom: 1px dashed rgba(120, 150, 200, 0.16); }
.qa-item:last-child { border-bottom: none; }
.qa-q { font-weight: 700; margin-bottom: 6px; }
.qa-a { opacity: 0.9; }
.qa-a code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: rgba(120, 150, 200, 0.12); padding: 1px 6px; border-radius: 6px;
}

/* ================= 伪装检测 ================= */
#view-disguise .hero { padding: 26px 30px 24px; text-align: center; }
#view-disguise .hero:after { display: none; }
#view-disguise .hero .eyebrow { display: block; }
#view-disguise .hero h1 { font-size: 38px; margin: 8px 0 5px; letter-spacing: -1.5px; }
#view-disguise .hero p { font-size: 14px; margin: 0 0 18px; }
#view-disguise .card { padding: 24px 26px; }
.dsg-disclaimer {
  text-align: center; color: var(--muted); font-size: 12px;
  margin: 12px 0 0; letter-spacing: 0.5px;
}
/* 检测过渡动画 */
#dsgScoreCard.card-in { animation: dsgCardIn 0.5s ease-out backwards; }
.dim-card.dsg-card-in { animation: dsgCardIn 0.5s ease-out backwards; }
#dsgFixCard.dsg-card-in { animation: dsgCardIn 0.5s ease-out backwards; }
@keyframes dsgCardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* 逐项检测动画 */
.st-checking { background: var(--bar-bg); color: var(--muted); }
.st-checking::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%;
  vertical-align: -1px; animation: dsgSpin 0.7s linear infinite;
}
@keyframes dsgSpin { to { transform: rotate(360deg); } }
.check-list li.dsg-item-in { animation: dsgItemIn 0.35s ease-out; }
@keyframes dsgItemIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .dim-card.dsg-card-in, #dsgFixCard.dsg-card-in, #dsgScoreCard.card-in, .check-list li.dsg-item-in { animation: none; }
  .st-checking::before { animation: none; }
}
.btn-start {
  display: inline-block; padding: 13px 44px; border: none; cursor: pointer;
  border-radius: 14px; background: var(--btn-bg); color: #fff;
  font-weight: 700; font-size: 15px; box-shadow: 0 7px 18px #1677ff42;
}
.btn-start:disabled { opacity: 0.6; cursor: default; }
.score-overview { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.score-ring { position: relative; width: 140px; height: 140px; flex: none; }
.score-ring svg { width: 100%; height: 100%; display: block; }
.score-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-text b { font-size: 38px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.score-text span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.score-detail { flex: 1; min-width: 240px; }
.dim-dots { display: flex; flex-direction: column; gap: 14px; }
.dot-row { display: flex; align-items: center; gap: 14px; }
.dot-meta { flex: none; width: 86px; }
.dot-meta b { font-size: 14px; display: block; }
.dot-meta span { font-size: 12px; color: var(--muted); }
.dots { display: flex; align-items: center; gap: 5px; flex: 1; }
.dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--bar-bg); flex: none; }
.dots i.on-g { background: #30d158; }
.dots i.on-b { background: #0a84ff; }
.dots i.on-p { background: #bf5af2; }
.dots i.on-o { background: #ff9f0a; }
.dots b { font-size: 17px; font-weight: 700; margin-left: 10px; min-width: 30px; text-align: right; flex: none; }
/* 移动端：圆点行垂直堆叠，避免横向溢出 */
@media (max-width: 640px) {
  .dot-row { flex-wrap: wrap; gap: 8px; }
  .dot-meta { width: 100%; display: flex; align-items: baseline; gap: 8px; }
  .dot-meta b { display: inline; }
  .dot-meta span { display: inline; }
  .dots { flex: 1 1 100%; gap: 4px; }
  .dots i { width: 11px; height: 11px; }
  .score-overview { gap: 18px; }
  .score-ring { width: 120px; height: 120px; margin: 0 auto; }
}
.dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .dim-grid { grid-template-columns: 1fr; } }
.dim-card { margin-top: 18px; }
.dim-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dim-head h3 { font-size: 16px; margin: 0; }
.dim-head .weight { font-size: 12px; color: var(--muted); }
.dim-score { font-size: 26px; font-weight: 800; }
.dim-score small { font-size: 12px; color: var(--muted); font-weight: 400; }
.check-list { list-style: none; margin: 10px 0 0; padding: 0; }
.check-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; padding: 9px 0;
  border-top: 1px dashed var(--card-border);
}
.check-list li:first-child { border-top: none; }
.check-list .txt { flex: 1; line-height: 1.6; }
.check-list .txt small { display: block; color: var(--muted); font-size: 12px; }
.st { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: #fff; margin-top: 1px; }
.st-info { background: #5b9dff; }
.st-ok { background: linear-gradient(180deg, #25c977, #0eaa5c); }
.st-warn { background: linear-gradient(180deg, #ff9f0a, #f67b1f); }
.st-risk { background: linear-gradient(180deg, #ff5b5b, #e5484d); }
.fix-list { margin: 0; padding: 0; list-style: none; counter-reset: fix; }
.fix-list li { counter-increment: fix; display: flex; gap: 12px; padding: 10px 0; font-size: 14px; border-top: 1px dashed var(--card-border); line-height: 1.65; }
.fix-list li:first-child { border-top: none; }
.fix-list li::before {
  content: counter(fix); flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 159, 10, 0.14); color: #f67b1f;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.qa h4 { font-size: 14px; margin: 16px 0 6px; }
.qa h4:first-child { margin-top: 0; }
.qa p, .qa ul { font-size: 13.5px; color: var(--muted); line-height: 1.75; margin: 0 0 8px; }
.qa ul { padding-left: 18px; }
.qa b { color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.legend .st { margin-top: 0; }

/* Cookie 同意横幅 */
.cookie-banner{position:fixed;left:16px;right:16px;bottom:16px;z-index:200;max-width:640px;margin:0 auto;
  display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;
  padding:14px 18px;border-radius:16px;font-size:13.5px;line-height:1.6;
  background:var(--card,rgba(255,255,255,.85));backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  border:1px solid var(--card-border,rgba(0,0,0,.08));box-shadow:0 12px 40px rgba(0,0,0,.14)}
.cookie-banner p{margin:0;flex:1;min-width:220px;color:var(--muted,#555)}
.cookie-banner a{color:inherit;text-decoration:underline}
.cookie-btns{display:flex;gap:10px;flex:none}
.cookie-btns button{padding:8px 20px;border-radius:999px;border:none;font-size:13.5px;font-weight:600;cursor:pointer;
  background:#111;color:#fff}
.cookie-btns button.ghost{background:transparent;color:var(--text,#111);border:1px solid var(--card-border,rgba(0,0,0,.15))}
[data-theme="dark"] .cookie-btns button{background:#fff;color:#111}
[data-theme="dark"] .cookie-btns button.ghost{background:transparent;color:#fff}

/* 法律页面（SPA 视图）：legal-wrap 用 display:contents 消除包装层，卡片直接对标主站 .card 宽度 */
.legal-wrap{display:contents}
.legal-wrap h1{font-size:28px;margin:8px 0 4px}
.legal-wrap h2{font-size:19px;margin:0 0 10px}
.legal-wrap p,.legal-wrap li{font-size:15px;color:var(--muted)}
.legal-wrap ul{padding-left:22px}
.legal-wrap .updated{font-size:13px;color:var(--muted);opacity:.8}
.legal-wrap a{color:inherit;text-decoration:underline}
.legal-card{background:var(--card);border:1px solid rgba(255,255,255,.95);border-radius:22px;box-shadow:var(--shadow);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);padding:26px 28px;margin:0 0 16px;line-height:1.8}
.legal-card h1{margin-top:0}
.legal-card h2:first-child{margin-top:0}
:root[data-theme="dark"] .legal-card{border-color:rgba(255,255,255,.07)}
@media(max-width:560px){.legal-card{padding:20px}}
.legal-wrap .lang-en{display:none}
html[lang="en"] .legal-wrap .lang-zh{display:none}
html[lang="en"] .legal-wrap .lang-en{display:block}
.legal-wrap .feat-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}
.legal-wrap .feat{border:1px solid var(--card-border);border-radius:14px;padding:16px;background:var(--card)}
.legal-wrap .feat b{display:block;font-size:15px;margin-bottom:6px;color:var(--text)}
.legal-wrap .feat span{font-size:13.5px;color:var(--muted)}
@media(max-width:560px){.legal-wrap .feat-grid{grid-template-columns:1fr}}
.legal-wrap .contact-card{border:1px solid var(--card-border);border-radius:14px;padding:20px;background:var(--card);margin-top:16px}

/* Logo ISP 绿底徽章 */
.logo-isp{background:rgba(37,201,119,.16);color:#0e9e57;padding:1px 3px;border-radius:4px;margin-right:0;font-weight:800}
:root[data-theme="dark"] .logo-isp{background:rgba(37,201,119,.22);color:#2fd07f}
