/* ==========================================================================
   IP 查询站 · 设计系统
   视觉语言参照 cleanip.io：浅灰绿底 + 白卡 + 点线引导行 + 分段评分条
   ========================================================================== */

:root {
  --bg: #f4f5f4;
  --bg-soft: #eceeec;
  --card: #ffffff;
  --card-2: #fafbfa;

  --ink: #202124;
  --ink-2: #3c4043;
  --ink-3: #5f6368;
  --text: #6b7280;
  --muted: #9aa0a6;

  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.16);
  --line-3: #e8eae8;

  --brand: #35a952;
  --brand-hover: #2e9046;
  --brand-bg: #eff8f1;
  --brand-line: #b8e1c2;
  --brand-ink: #1c7a39;

  --ok: #35a952;
  --ok-bg: #eff8f1;
  --ok-line: #bee3c8;
  --warn: #ea580c;
  --warn-bg: #fef3ee;
  --warn-line: #f9cdb6;
  --danger: #dc2626;
  --danger-bg: #fdf2f2;
  --danger-line: #f5c2c2;
  --info: #2f6fed;
  --info-bg: #eef3fe;
  --info-line: #c3d5fb;
  --violet: #6e2eeb;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;

  --sh-card: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 20px -8px rgba(15, 23, 42, 0.1);
  --sh-pop: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
  --sh-nav: 0 1px 0 rgba(0, 0, 0, 0.06), 0 8px 24px -14px rgba(15, 23, 42, 0.24);

  --shell: 1216px;
  --nav-h: 56px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Google Sans", "Google Sans Text", "Segoe UI", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: #cdebd6; }

.mono, .ip-text {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
}

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- 顶部导航 */

.topnav {
  position: sticky; top: 0; z-index: 60;
  background: rgba(244, 245, 244, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topnav__inner {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: 10px; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: radial-gradient(120% 120% at 30% 20%, #5ec97a, #2e9046 60%, #1f6f34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 6px -2px rgba(46,144,70,.7);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
  letter-spacing: -0.5px;
}
.brand__word { font-size: 15.5px; font-weight: 700; letter-spacing: -0.3px; }
.brand__word span { color: var(--brand); }

.navlinks { display: flex; align-items: center; gap: 2px; }
.navlink {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border-radius: 8px;
  color: var(--ink-3); font-size: 13px; font-weight: 500;
  border: 0; background: transparent; white-space: nowrap;
}
.navlink:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.navlink .dot-tag {
  font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: 4px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line);
  font-weight: 600;
}

.navsearch {
  margin-left: auto; display: flex; align-items: center;
  height: 34px; padding: 0 4px 0 10px; gap: 6px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color .15s, box-shadow .15s;
  width: 300px;
}
.navsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(53, 169, 82, 0.12); }
.navsearch svg { color: var(--muted); flex: none; }
.navsearch input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.navsearch input::placeholder { font-family: inherit; color: var(--muted); font-size: 12.5px; }
.navsearch__go {
  height: 26px; padding: 0 11px; border-radius: 999px; border: 0;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.navsearch__go:hover { background: var(--brand-hover); }

.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--ink-3);
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.05); color: var(--ink); }
.btn-ghost {
  height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-bg); }

/* ------------------------------------------------------------------ Hero */

.hero { padding: 30px 0 18px; }
.hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero h1 {
  margin: 0 0 6px; font-size: 27px; line-height: 1.25; letter-spacing: -0.6px; font-weight: 700;
}
.hero p { margin: 0; color: var(--text); font-size: 13px; max-width: 620px; }
.hero__stats { display: flex; gap: 22px; flex: none; }
.hero__stat b { display: block; font-size: 19px; letter-spacing: -0.4px; }
.hero__stat span { font-size: 11.5px; color: var(--muted); }

.searchbar {
  margin-top: 16px; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-xl);
  padding: 7px 7px 7px 14px;
  box-shadow: var(--sh-card);
  transition: border-color .18s, box-shadow .18s;
}
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(53, 169, 82, .1), var(--sh-card); }
.searchbar__icon { color: var(--muted); flex: none; }
.searchbar input {
  flex: 1; min-width: 0; height: 34px; border: 0; outline: 0; background: transparent;
  font-size: 16px; letter-spacing: 0.2px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.searchbar input::placeholder { font-family: "Google Sans", "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 13.5px; color: var(--muted); }
.searchbar__hint kbd {
  font-family: inherit; font-size: 11px; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--muted);
}
.searchbar__btn {
  height: 38px; padding: 0 20px; border-radius: 11px; border: 0;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 14px -8px rgba(46,144,70,.9);
}
.searchbar__btn:hover { background: var(--brand-hover); }
.searchbar__btn:disabled { opacity: .6; cursor: progress; }

.quickrow {
  margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.quick-chip {
  border: 1px solid var(--line-2); background: rgba(255,255,255,.7); border-radius: 999px;
  padding: 3px 9px; font-size: 11.5px; color: var(--ink-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.quick-chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-bg); }

/* ------------------------------------------------------------------ Tabs */

.tabbar {
  position: sticky; top: var(--nav-h); z-index: 50;
  background: rgba(244, 245, 244, .92);
  backdrop-filter: blur(12px);
  padding: 8px 0 10px;
}
.tabbar__inner { display: flex; align-items: center; gap: 10px; }
.tabs {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; border-radius: 999px;
  height: 30px; padding: 0 13px; font-size: 12.8px; font-weight: 600; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--brand-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tab.is-active .tab__dot { background: var(--brand); }
.tab__dot { width: 5px; height: 5px; border-radius: 50%; background: #cfd4cf; }
.tabbar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ Card */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  overflow: hidden;
}
.card + .card, .stack > * + * { margin-top: 14px; }
.card__head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card__head h2, .card__head h3 {
  margin: 0; font-size: 13.5px; font-weight: 700; letter-spacing: -0.1px;
  display: inline-flex; align-items: center; gap: 7px;
}
.card__head .sec-ico { color: var(--brand); display: inline-flex; }
.card__head--plain { border-bottom: 0; padding-bottom: 4px; }
.card__meta { margin-left: auto; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.card__body { padding: 14px 16px; }
.card__body--flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--sidebar { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }

/* ------------------------------------------------------- 键值行（点线引导） */

.kv {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; min-height: 42px;
}
.kv + .kv { border-top: 1px solid rgba(0, 0, 0, 0.045); }
.kv__ico { color: var(--muted); display: inline-flex; flex: none; }
.kv__k { color: var(--ink-3); font-size: 12.5px; flex: none; }
.kv__lead {
  flex: 1; min-width: 14px; height: 1px; margin: 0 2px;
  border-bottom: 1px dashed #dfe3df; align-self: center; transform: translateY(1px);
}
.kv__v { font-size: 12.8px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; text-align: right; }
.kv__v > * { min-width: 0; }
.kv__v--weak { font-weight: 500; color: var(--ink-3); }
.kv__sub { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.kv--tight { padding: 8px 16px; min-height: 36px; }

.flag { width: 17px; height: 12px; border-radius: 2.5px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex: none; }

/* ------------------------------------------------------------------ Chips */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 7px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; white-space: nowrap;
}
.chip svg { flex: none; }
.chip--ok { background: var(--ok-bg); color: #2b7f42; border-color: var(--ok-line); }
.chip--warn { background: var(--warn-bg); color: #b8460b; border-color: var(--warn-line); }
.chip--danger { background: var(--danger-bg); color: #b91c1c; border-color: var(--danger-line); }
.chip--info { background: var(--info-bg); color: #2559c4; border-color: var(--info-line); }
.chip--idle { background: #f6f7f6; color: #8a9088; border-color: #e3e6e3; }
.chip--dashed { background: #fff; color: #8a9088; border: 1px dashed #cfd4cf; }
.chip--brand { background: var(--brand-bg); color: var(--brand-ink); border-color: var(--brand-line); }
.chip--link { cursor: pointer; }
.chip--link:hover { filter: brightness(.97); }

.ver-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
  border-radius: 6px; background: var(--brand-bg); color: var(--brand-ink);
  border: 1px solid var(--brand-line); font-size: 11px; font-weight: 700;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ------------------------------------------------------- IP 头部 / 评分区 */

.iphead { padding: 16px 16px 12px; }
.iphead__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iphead__label { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.iphead__ip {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 21px; font-weight: 700; letter-spacing: -0.2px;
}
.iphead__btns { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.mini-btn {
  height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2);
  background: #fff; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 5px;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-bg); }

.scorewrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: center; padding: 6px 0 2px; }
.score-big { display: flex; align-items: flex-end; gap: 6px; }
.score-big__num {
  font-size: 60px; line-height: .92; font-weight: 700; letter-spacing: -2.5px;
  color: var(--brand);
}
.score-big__grade { font-size: 15px; font-weight: 700; color: var(--ink-3); padding-bottom: 6px; }
.score-big__of { font-size: 12px; color: var(--muted); padding-bottom: 8px; }
.score-sub { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }

.gradebar { margin-top: 4px; }
.gradebar__track { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.gradebar__seg {
  flex: 1; border-radius: 3px 3px 2px 2px; height: 12px; position: relative;
  transition: height .3s;
}
.gradebar__seg.is-current { height: 22px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(0,0,0,.14); }
.gradebar__labels { display: flex; margin-top: 5px; }
.gradebar__labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.gradebar__labels span.is-current { color: var(--ink); font-weight: 700; }
.gradebar__marker {
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 4px;
  font-size: 10.5px; color: var(--ink-3);
}
.gradebar__pill {
  align-self: flex-start; font-size: 10px; font-weight: 700; color: #fff;
  padding: 1px 6px; border-radius: 4px; background: var(--ink);
}

/* 十格分段量表（参考维度） */
.meter { display: flex; gap: 2px; flex: 1; min-width: 60px; }
.meter i { flex: 1; height: 7px; border-radius: 2px; background: #e9ece9; }
.meter i.on { background: var(--brand); }
.meter--warn i.on { background: #f0a03c; }
.meter--danger i.on { background: #e2564a; }
.meter-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.meter-row__k { width: 76px; font-size: 12.5px; color: var(--ink-3); flex: none; }
.meter-row__n { width: 30px; text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut { position: relative; width: 108px; height: 108px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut__center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.donut__center b { font-size: 17px; letter-spacing: -0.4px; display: block; line-height: 1.1; }
.donut__center span { font-size: 10px; color: var(--muted); }
.legend { display: grid; gap: 6px; font-size: 11.5px; flex: 1; min-width: 0; }
.legend__item { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.legend__dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.legend__pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }

/* 场景适配 */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--card-2); text-align: center;
}
.tile__ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: var(--ink-3);
}
.tile__nm { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.tile__st { font-size: 10px; font-weight: 700; }
.tile--ok .tile__st { color: var(--ok); }
.tile--ok .tile__ico { background: var(--ok-bg); border-color: var(--ok-line); color: var(--brand-ink); }
.tile--test .tile__st { color: var(--warn); }
.tile--test .tile__ico { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.tile--no .tile__st { color: var(--muted); }
.tile--no { opacity: .72; }

/* ------------------------------------------------------------------ 地图 */

.mapbox { position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: #eef1ee; }
.mapbox__canvas { height: 214px; width: 100%; }
.mapbox__badge {
  position: absolute; left: 8px; bottom: 8px; z-index: 400;
  background: rgba(255, 255, 255, .93); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px;
  font-size: 10.5px; color: var(--ink-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.mapbox__fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 4px;
  text-align: center; color: var(--muted); font-size: 11.5px;
  background: repeating-linear-gradient(45deg, #f2f4f2, #f2f4f2 8px, #eef1ee 8px, #eef1ee 16px);
}
.leaflet-container { font: inherit; background: #eef1ee; }
.leaflet-control-attribution { font-size: 9px !important; opacity: .65; }

/* ------------------------------------------------------------------ 表格 */

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-weight: 600; font-size: 11px; color: var(--muted);
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--card-2);
  letter-spacing: .3px;
}
.tbl td { padding: 9px 16px; border-bottom: 1px solid rgba(0, 0, 0, .045); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fcfdfc; }
.tbl__src { font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.tbl__mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* --------------------------------------------------------- 风险矩阵 */

.risk-summary { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text); }
.risk-summary b { color: var(--ink); }
.risk-group { display: flex; align-items: center; gap: 10px; padding: 11px 16px; }
.risk-group + .risk-group { border-top: 1px solid rgba(0, 0, 0, .045); }
.risk-group__nm { width: 122px; flex: none; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.risk-group__cnt { font-size: 11px; color: var(--muted); font-weight: 500; }
.risk-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex: 1; min-width: 0; }
.risk-chip {
  display: flex; align-items: center; gap: 5px; justify-content: flex-start;
  height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 11.5px; color: var(--ink-3); min-width: 0;
}
.risk-chip__glyph { width: 13px; height: 13px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.risk-chip__nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-chip--clear { background: #fbfdfb; color: #7d857f; }
.risk-chip--clear .risk-chip__glyph { background: var(--ok-bg); color: var(--brand); border: 1px solid var(--ok-line); }
.risk-chip--hit { background: var(--danger-bg); border-color: var(--danger-line); color: #a51f1f; font-weight: 600; }
.risk-chip--hit .risk-chip__glyph { background: #fff; color: var(--danger); border: 1px solid var(--danger-line); }
.risk-chip--warn { background: var(--warn-bg); border-color: var(--warn-line); color: #a8430a; }
.risk-chip--warn .risk-chip__glyph { background: #fff; color: var(--warn); border: 1px solid var(--warn-line); }
.risk-chip--unknown { background: #fafafa; border-style: dashed; border-color: #d7dbd7; color: #9aa09a; }
.risk-chip--unknown .risk-chip__glyph { background: #fff; border: 1px dashed #d7dbd7; color: #b3b8b3; }
.risk-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.risk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.risk-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.notice {
  display: flex; gap: 9px; padding: 11px 14px; border-radius: var(--r-md);
  background: var(--card-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--text); line-height: 1.6;
}
.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); color: #8a3c10; }
.notice--info { background: var(--info-bg); border-color: var(--info-line); color: #1e4aa8; }
.notice b { color: inherit; }
.notice__ico { flex: none; margin-top: 1px; }

/* --------------------------------------------------------- 工具面板 */

.field { display: grid; gap: 5px; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.input, .select, .textarea {
  height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: #fff; outline: 0; font-size: 12.8px;
  transition: border-color .15s, box-shadow .15s;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.textarea { height: auto; min-height: 90px; padding: 8px 10px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(53, 169, 82, .12);
}
.select { font-family: inherit; }
.btn {
  height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: #fff; font-size: 12.8px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-bg); }
.btn--primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 150px; }

.code-out {
  margin: 0; padding: 12px 14px; border-radius: var(--r-md);
  background: #1d211d; color: #d8e6d8; font-size: 12px; line-height: 1.7;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.code-out .k { color: #7fd39a; }
.code-out .m { color: #8f9b8f; }

/* 延迟测试 */
.lat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.lat-item { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2); }
.lat-item__top { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.lat-item__tag { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.lat-item__val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lat-item__val small { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.dots { display: flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #e3e6e3; }
.dots i.on { background: var(--brand); }
.dots i.mid { background: #f0b03c; }
.dots i.bad { background: #e2564a; }

/* 我的 IP 卡片 */
.mine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ip-big {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 20px; font-weight: 700; letter-spacing: -0.2px;
}
.copy-mini { border: 0; background: transparent; color: var(--muted); padding: 2px; border-radius: 4px; }
.copy-mini:hover { color: var(--brand); background: var(--brand-bg); }

/* 第三方源对比（skk 风格） */
.src-list { display: grid; }
.src-item { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid rgba(0,0,0,.045); font-size: 12px; }
.src-item:first-child { border-top: 0; }
.src-item__nm { width: 92px; font-weight: 600; color: var(--ink-2); flex: none; }
.src-item__ip { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-3); width: 128px; flex: none; }
.src-item__loc { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 骨架屏 */
.sk {
  background: linear-gradient(90deg, #eef0ee 25%, #f6f7f6 37%, #eef0ee 63%);
  background-size: 400% 100%; border-radius: 5px;
  animation: sk 1.3s ease infinite;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 11px; }

/* 空状态 */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast {
  background: #1f2421; color: #f2f7f3; border-radius: 999px;
  padding: 8px 16px; font-size: 12.5px; box-shadow: var(--sh-pop);
  animation: toastIn .22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------- 页脚 */

.footer { margin-top: 34px; background: #0e100e; color: #b9c2ba; padding: 40px 0 0; }
.footer__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__brand .brand__word { color: #fff; font-size: 19px; }
.footer__brand .brand__word span { color: #4cc26c; }
.footer__desc { margin: 8px 0 0; font-size: 12px; color: #7e887f; max-width: 380px; }
.footer__cta { display: flex; gap: 8px; flex-wrap: wrap; }
.fbtn {
  height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04); color: #dfe7e0; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.fbtn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.24); }
.fbtn--brand { background: #2f9c4a; border-color: #2f9c4a; color: #fff; }
.fbtn--brand:hover { background: #37ae55; border-color: #37ae55; }

.footer__cols {
  margin-top: 34px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.09);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 18px;
}
.fcol__t { font-size: 12px; font-weight: 700; color: #eef3ef; margin-bottom: 9px; }
.fcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fcol a { font-size: 11.8px; color: #8b958c; }
.fcol a:hover { color: #c8e6cf; }
.fcol .soon { color: #58615a; font-size: 11.8px; }
.footer__bar {
  margin-top: 26px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: #6f7970;
}
.footer__bar .live { display: inline-flex; align-items: center; gap: 5px; }
.footer__bar .live i { width: 6px; height: 6px; border-radius: 50%; background: #4cc26c; box-shadow: 0 0 0 3px rgba(76,194,108,.18); }
.footer__social { margin-left: auto; display: flex; gap: 6px; }
.footer__social a { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: #8b958c; }
.footer__social a:hover { background: rgba(255,255,255,.08); color: #fff; }
.footer__word {
  font-size: clamp(70px, 15vw, 190px); font-weight: 700; letter-spacing: -6px; line-height: .8;
  color: #16301c; text-align: center; user-select: none; padding: 22px 0 0;
  overflow: hidden; white-space: nowrap;
}

/* --------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .grid--sidebar { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .shell { padding: 0 14px; }
  .navlinks { display: none; }
  .navsearch { width: auto; flex: 1; }
  .hero h1 { font-size: 22px; }
  .hero__row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero__stats { display: none; }
  .scorewrap { grid-template-columns: 1fr; gap: 10px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .mine-grid { grid-template-columns: 1fr; }
  .risk-cells { grid-template-columns: repeat(3, 1fr); }
  .risk-group { flex-direction: column; align-items: stretch; }
  .risk-group__nm { width: auto; }
  .lat-grid { grid-template-columns: repeat(2, 1fr); }
  .tabbar__right { display: none; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { flex-wrap: wrap; }
  .kv__lead { display: none; }
  .kv__v { justify-content: flex-start; }
  .footer__word { letter-spacing: -3px; }
}

/* --------------------------------------------------- 地图标记脉冲动画 */
@keyframes pulse {
  0%   { transform: scale(1);   opacity: .25; }
  70%  { transform: scale(2.8); opacity: 0; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ------------------------------------------------------- 打印与降级 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --------------------------------------------------- 命中 / 扣分列表行 */
.hitrow { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; padding: 5px 0; }
.hitrow + .hitrow { border-top: 1px dashed #eceeec; }
.hitrow__i { flex: none; margin-top: 1px; }
.hitrow__n { font-weight: 600; color: var(--ink-2); flex: none; }
.hitrow__w { color: var(--ink-3); margin-left: auto; text-align: right; max-width: 68%; line-height: 1.45; }
