/* ============================================================
   设计系统: Linear & Raycast Aesthetic — 浅色版
   保留原版全部结构与交互(Bento网格/探针延迟/复制按钮/光晕层),
   仅将配色由暗色重做为浅色,并在细节上进一步打磨观感。
   ============================================================ */

:root {
  --bg-deep: #f6f7fb;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.92);

  --border-card: rgba(15, 17, 21, 0.08);
  --border-beam: rgba(94, 106, 210, 0.35);

  --text-pure: #14151a;
  --text-regular: #4b4f5a;
  --text-muted: #767b87;
  --text-faint: #a3a8b3;

  --accent-brand: #5e6ad2;
  --accent-blue: #2563eb;
  --accent-cyan: #0891b2;
  --accent-emerald: #059669;
  --accent-amber: #b45309;
  --accent-rose: #be123c;

  --font-text: 'Geist', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-pure);
  font-family: var(--font-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.glow-canvas {
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  width: 1100px;
  height: 620px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.24) 0%, rgba(37, 99, 235, 0.10) 45%, transparent 75%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  backface-visibility: hidden;
}

.grid-layer {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 17, 21, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 17, 21, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 60%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 60%, transparent 95%);
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.viewport-shell {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 80px;
  position: relative;
  z-index: 1;
}

/* 视图切换:同页面内的Tab,不是跨页面导航 */
.view-switch {
  display: inline-flex;
  gap: 2px;
  background: rgba(15, 17, 21, 0.04);
  border: 1px solid rgba(15, 17, 21, 0.07);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.view-switch-btn {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-switch-btn:hover {
  color: var(--text-pure);
}

.view-switch-btn.active {
  background: #fff;
  color: var(--text-pure);
  box-shadow: 0 1px 3px rgba(15, 17, 21, 0.10);
}

.linear-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow: 0 14px 34px -14px rgba(20, 21, 26, 0.14), inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.linear-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(15, 17, 21, 0.12);
}

.card-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-beam) 50%, transparent 100%);
  pointer-events: none;
}

.focal-card {
  padding: 30px 32px 28px;
  margin-bottom: 16px;
}

.pulse-beacon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.5);
  flex-shrink: 0;
}

.badge-cluster {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px 6px 10px;
  border-radius: 8px;
  background: rgba(15, 17, 21, 0.035);
  border: 1px solid rgba(15, 17, 21, 0.06);
  color: var(--text-faint);
}

.mini-tag-location {
  color: var(--text-regular);
  font-weight: 500;
}

.tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.mini-tag.active {
  color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.10);
  border-color: rgba(5, 150, 105, 0.25);
}

.mini-tag.danger {
  color: var(--accent-rose);
  background: rgba(190, 18, 60, 0.10);
  border-color: rgba(190, 18, 60, 0.25);
}

/* IP质量分数用普通mini-tag外观,配合.active/.warn/.danger三档颜色即可,没有额外样式 */

.mini-tag.warn {
  color: var(--accent-amber);
  background: rgba(180, 83, 9, 0.10);
  border-color: rgba(180, 83, 9, 0.25);
}

.ip-touch-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ip-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 340px;
  min-width: 0;
  background: rgba(15, 17, 21, 0.035);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  padding: 10px 12px 10px 18px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.ip-search-box:focus-within {
  border-color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.04);
}

.ip-search-box.input-error {
  animation: input-shake 0.4s ease;
  border-color: var(--accent-rose);
  background: rgba(190, 18, 60, 0.04);
}

@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.search-icon {
  color: var(--text-faint);
  flex-shrink: 0;
}

.ip-search-box:focus-within .search-icon {
  color: var(--accent-blue);
}

.ip-text {
  font-family: var(--font-mono);
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-pure);
  line-height: 1;
}

.ip-input {
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

.ip-input:focus {
  outline: none;
}

.ip-input::placeholder {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 15px;
  font-family: var(--font-text);
}

.search-btn {
  flex-shrink: 0;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-text);
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-btn:hover {
  background: #1d4ed8;
}

.reset-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-faint);
  padding: 0 4px 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-text);
  cursor: pointer;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.reset-tag:hover {
  color: var(--accent-blue);
}

.verdict-banner {
  background: rgba(15, 17, 21, 0.03);
  border-radius: 16px;
  padding: 20px 22px;
  border: none;
}

.verdict-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.status-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.verdict-lead strong {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-pure);
}

.verdict-banner p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 19px;
  margin: 0;
}

.verdict-banner.tone-blue {
  background: rgba(37, 99, 235, 0.09);
}
.verdict-banner.tone-blue .verdict-lead strong { color: #1d4ed8; }
.verdict-banner.tone-blue .status-indicator { background: var(--accent-blue); box-shadow: 0 0 6px rgba(37, 99, 235, 0.5); }

.verdict-banner.tone-green {
  background: rgba(5, 150, 105, 0.09);
}
.verdict-banner.tone-green .verdict-lead strong { color: #047857; }
.verdict-banner.tone-green .status-indicator { background: var(--accent-emerald); box-shadow: 0 0 6px rgba(5, 150, 105, 0.5); }

.verdict-banner.tone-amber {
  background: rgba(180, 83, 9, 0.10);
}
.verdict-banner.tone-amber .verdict-lead strong { color: #92400e; }
.verdict-banner.tone-amber .status-indicator { background: var(--accent-amber); box-shadow: 0 0 6px rgba(180, 83, 9, 0.5); }

.verdict-banner.tone-red {
  background: rgba(190, 18, 60, 0.09);
}
.verdict-banner.tone-red .verdict-lead strong { color: #9f1239; }
.verdict-banner.tone-red .status-indicator { background: var(--accent-rose); box-shadow: 0 0 6px rgba(190, 18, 60, 0.5); }

.bento-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bento-tile {
  padding: 24px;
}

.tile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.tile-icon {
  color: var(--accent-cyan);
  display: flex;
}

.tile-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-pure);
}

.datum-stack {
  display: flex;
  flex-direction: column;
}

.datum-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 11px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(15, 17, 21, 0.06);
}

.datum-row:last-child {
  border-bottom: none;
}

.datum-label {
  color: var(--text-muted);
}

.datum-val {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-pure);
  text-align: right;
  max-width: 65%;
  word-break: break-all;
}

/* 长文本(比如User-Agent、显卡渲染器)不适合塞进"标签+数值"同一行,
   改成标签在上、内容单独放进一个浅底代码框里,不管卡片多窄都能自然换行 */
/* ---------- 环境一致性对比表 ---------- */
.consistency-table {
  border-top: 1px solid var(--border-card);
  margin-top: 4px;
}

.consistency-row {
  display: grid;
  grid-template-columns: 128px 1fr 1fr 92px;
  gap: 16px;
  align-items: center;
  padding: 12px 4px;
  font-size: 13px;
  border-bottom: 1px solid rgba(15, 17, 21, 0.05);
}

.consistency-row:last-child {
  border-bottom: none;
}

.consistency-row.row-warn {
  background: rgba(180, 83, 9, 0.055);
}

.consistency-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 0;
}

.consistency-head span:last-child {
  text-align: right;
}

.consistency-label {
  color: var(--text-muted);
  font-weight: 500;
}

.consistency-browser,
.consistency-ip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-pure);
  word-break: break-word;
}

.consistency-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  width: fit-content;
  justify-self: end;
}

.consistency-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.consistency-status.ok {
  color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.10);
}
.consistency-status.warn {
  color: var(--accent-amber);
  background: rgba(180, 83, 9, 0.12);
}
.consistency-status.unknown {
  color: var(--text-faint);
  background: rgba(15, 17, 21, 0.045);
}

@media (max-width: 720px) {
  .consistency-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label status"
      "browser ip";
    row-gap: 8px;
  }
  .consistency-row.consistency-head { display: none; }
  .consistency-row .consistency-status { grid-area: status; }
  .consistency-row .consistency-label { grid-area: label; text-align: left; font-weight: 600; color: var(--text-pure); }
  .consistency-row .consistency-browser { grid-area: browser; }
  .consistency-row .consistency-ip { grid-area: ip; text-align: right; }
}

/* ---------- 场景适用性 ---------- */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

.scenario-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.scenario-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-pure);
}

.scenario-item-verdict {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.scenario-item-verdict.tone-good { color: var(--accent-emerald); }
.scenario-item-verdict.tone-mid { color: var(--accent-amber); }
.scenario-item-verdict.tone-bad { color: var(--accent-rose); }

.scenario-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.06);
  overflow: hidden;
}

.scenario-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease;
}

.scenario-bar-fill.tone-good { background: var(--accent-emerald); }
.scenario-bar-fill.tone-mid { background: var(--accent-amber); }
.scenario-bar-fill.tone-bad { background: var(--accent-rose); }

.field-block {
  padding: 12px 0 16px;
}

.field-block .field-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-block .field-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-pure);
  background: rgba(15, 17, 21, 0.035);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.6;
  word-break: break-all;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-header h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-pure);
}

.detail-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.probe-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.probe-item {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.probe-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.probe-scope {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-blue   { background: rgba(37, 99, 235, 0.12);  color: #1d4ed8; }
.tag-purple { background: rgba(147, 51, 234, 0.12); color: #7e22ce; }
.tag-amber  { background: rgba(180, 83, 9, 0.14);   color: #92400e; }

.scope-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-pure);
}

.probe-ms {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(15, 17, 21, 0.045);
  padding: 3px 8px;
  border-radius: 6px;
}

.probe-ms.ready {
  color: #047857;
  background: rgba(5, 150, 105, 0.12);
}

.probe-ms.fail {
  color: #9f1239;
  background: rgba(190, 18, 60, 0.12);
}

.probe-ip {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-pure);
  margin-bottom: 2px;
  word-break: break-all;
}

.probe-item.probe-ok .probe-ip {
  color: var(--accent-blue);
}

.probe-loc {
  font-size: 13px;
  color: var(--text-muted);
}

.probe-row-foot {
  border-top: 1px solid rgba(15, 17, 21, 0.06);
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.foot-orb {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.probe-item.probe-ok .probe-row-foot { color: #047857; }
.probe-item.probe-fail .probe-row-foot { color: #9f1239; }

.linear-footer {
  text-align: center;
  margin-top: 44px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- 页尾:浅色主题,只留一个大字品牌水印,干净收尾 ---------- */
.site-footer {
  padding: 64px 20px 56px;
  text-align: center;
  border-top: 1px solid rgba(15, 17, 21, 0.06);
}

.footer-watermark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(56px, 13vw, 150px);
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}




.conn-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

.bento-tile-wide {
  grid-column: span 2;
}

/* ---------- 地图卡片 ---------- */
.map-canvas {
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 17, 21, 0.03);
  position: relative;
  contain: layout paint;
  transform: translateZ(0);
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
  background: rgba(15, 17, 21, 0.025);
  z-index: 500;
}

.map-canvas .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 640px) {
  .viewport-shell {
    padding: 28px 14px 60px;
  }

  .focal-card {
    padding: 20px 16px 18px;
    border-radius: 18px;
  }

  /* 搜索框:窄屏下数字和图标都缩一档,查询按钮跟着变紧凑,避免挤爆一行 */
  .ip-touch-container {
    width: 100%;
    gap: 10px;
    margin-bottom: 18px;
  }

  .ip-search-box {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 8px 8px 14px;
    gap: 8px;
    border-radius: 14px;
  }

  .search-icon {
    width: 17px;
    height: 17px;
  }

  .ip-text {
    font-size: 20px;
  }

  .ip-input::placeholder {
    font-size: 12.5px;
  }

  .search-btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  /* 本机IP按钮:窄屏下只留图标,不显示文字,避免跟搜索框挤不下、被挤到第二行 */
  .reset-tag {
    flex-shrink: 0;
    padding: 0 2px 0 6px;
  }

  .reset-tag span {
    display: none;
  }

  .reset-tag svg {
    width: 15px;
    height: 15px;
  }

  /* 标签行:窄屏下改成固定两列网格,不用flex自动换行(内容长度不一容易换行不整齐、落单) */
  .badge-cluster {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }

  /* 机房IP和IPv6这两个药丸,手机端左右调换视觉位置(不改DOM顺序,只调显示顺序) */
  /* DOM顺序现在已经是 location/ipv6/原生IP/机房家宽/评分,天然符合手机端排布要求,不用再额外调order */
  #score-badge { grid-column: span 2; }

  /* IP质量分数改成JS动态生成渐变背景,桌面手机统一,这里不用再单独处理 */

  .mini-tag {
    font-size: 11px;
    padding: 7px 10px;
    justify-content: center;
  }

  /* 结论横幅:窄屏下字号和留白都收一收,不然会显得过大 */
  .verdict-banner {
    padding: 16px 16px;
    border-radius: 14px;
  }

  .verdict-lead strong {
    font-size: 16px;
  }

  .verdict-banner p {
    font-size: 12.5px;
    padding-left: 19px;
  }

  .bento-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bento-tile {
    padding: 20px 18px;
    border-radius: 18px;
  }

  .bento-tile-wide {
    grid-column: span 1;
  }

  .datum-row {
    padding: 10px 0;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 2px 0;
  }

  .datum-val {
    max-width: 100%;
    text-align: left;
  }

  .map-canvas {
    height: 220px;
  }

  .probe-item {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .probe-ip {
    font-size: 18px;
  }
}