/* ============================================================================
   IPSEC.PRO — 清爽高信任极简浅色设计系统（支持深色模式切换）
   ============================================================================ */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e5eaf1;
  --border-strong: #d3dce8;

  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;

  --green: #059669;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --orange: #ea580c;
  --orange-soft: #fff7ed;
  --orange-border: #fed7aa;

  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -4px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Inter", "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-subtle: #162033;
  --surface-hover: #1e293b;
  --border: #1f2b3e;
  --border-strong: #31415a;

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --brand: #3b82f6;
  --brand-hover: #60a5fa;
  --brand-soft: rgba(59, 130, 246, 0.14);
  --brand-border: rgba(59, 130, 246, 0.35);

  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --green-border: rgba(16, 185, 129, 0.32);

  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.32);

  --orange: #fb923c;
  --orange-soft: rgba(251, 146, 60, 0.14);
  --orange-border: rgba(251, 146, 60, 0.32);

  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.14);
  --red-border: rgba(248, 113, 113, 0.32);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px -4px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================================
   顶部导航栏（粘性毛玻璃，清爽克制）
   ============================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}
.brand-name {
  font-size: 17px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.brand-name span { color: var(--brand); }

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-subtle);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); background: var(--surface-hover); }
.nav-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.active-toggle {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

.btn-icon { width: 34px; padding: 0; }

/* ============================================================================
   页面主体与进度状态条
   ============================================================================ */
.main-wrap {
  padding: 20px 0 56px;
}

.share-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

.status-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.status-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.status-dot.running {
  box-shadow: 0 0 0 4px var(--brand-soft);
  animation: pulseDot 1.3s ease-in-out infinite;
}
.status-dot.done { background: var(--green); }
.status-dot.error { background: var(--red); }

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

.status-title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.status-sub { color: var(--text-muted); font-size: 12.5px; }

.status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  width: 160px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-hover);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  border-radius: 99px;
  transition: width 0.25s ease;
}
.progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

.ticker-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.ticker-toggle:hover { background: var(--surface-hover); color: var(--text); }

.ticker-log {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  max-height: 112px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ticker-log.collapsed { display: none; }
.ticker-line { display: flex; gap: 8px; }
.ticker-tag { color: var(--brand); font-weight: 600; min-width: 72px; }
.ticker-line.fail .ticker-tag { color: var(--red); }

/* ============================================================================
   卡片与通用布局
   ============================================================================ */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  margin: 0;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card-body { padding: 16px 18px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}
.section-heading h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-heading span { font-size: 12.5px; color: var(--text-muted); }

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-green  { background: var(--green-soft);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber);  border: 1px solid var(--amber-border); }
.badge-orange { background: var(--orange-soft); color: var(--orange); border: 1px solid var(--orange-border); }
.badge-red    { background: var(--red-soft);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-blue   { background: var(--brand-soft);  color: var(--brand);  border: 1px solid var(--brand-border); }
.badge-muted  { background: var(--surface-subtle); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================================
   首屏 Hero：左评分与异常 + 右 AI 三平台封号评估
   ============================================================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 18px;
  align-items: start;
}

.score-panel {
  padding: 20px;
}

.score-ring-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.score-ring {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.score-ring svg {
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
}
.score-ring-bg {
  fill: none;
  stroke: var(--surface-hover);
  stroke-width: 8;
}
.score-ring-fg {
  fill: none;
  stroke: var(--brand);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
}
.score-ring-val {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
  color: var(--text);
}
.score-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.score-meta-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.score-meta-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.score-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  text-align: center;
}
.score-stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.score-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* 快照对比条 */
.diff-ribbon {
  display: none;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.diff-ribbon.visible { display: block; }
.diff-ribbon-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 4px;
}
.diff-ribbon-body { color: var(--text-secondary); }

/* 异常项清单 */
.anomaly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}

.anomaly-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 2px;
}

.anomaly-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left-width: 3px;
  background: var(--surface-subtle);
}
.anomaly-item.sev-critical { border-left-color: var(--red); background: var(--red-soft); border-color: var(--red-border); }
.anomaly-item.sev-danger   { border-left-color: var(--orange); background: var(--orange-soft); border-color: var(--orange-border); }
.anomaly-item.sev-warn     { border-left-color: var(--amber); background: var(--amber-soft); border-color: var(--amber-border); }

.anomaly-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.anomaly-title { font-size: 12.5px; font-weight: 650; color: var(--text); }
.anomaly-detail { font-size: 11.5px; color: var(--text-secondary); line-height: 1.45; }
.anomaly-val {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}
.anomaly-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ============================================================================
   右侧：AI 三大平台封号风控评估卡片
   ============================================================================ */
.ai-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ai-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.ai-card:hover { border-color: var(--border-strong); }
.ai-card.risk-critical { border-top: 3px solid var(--red); }
.ai-card.risk-high     { border-top: 3px solid var(--orange); }
.ai-card.risk-medium   { border-top: 3px solid var(--amber); }
.ai-card.risk-low      { border-top: 3px solid var(--green); }

.ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ai-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ai-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.ai-icon-claude { background: #fef3e8; color: #c2591a; border: 1px solid #f7d5b5; }
.ai-icon-openai { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.ai-icon-gemini { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
[data-theme="dark"] .ai-icon-claude { background: rgba(217, 119, 6, 0.2); color: #fb923c; border-color: rgba(251, 146, 60, 0.35); }
[data-theme="dark"] .ai-icon-openai { background: rgba(16, 185, 129, 0.18); color: #34d399; border-color: rgba(52, 211, 153, 0.32); }
[data-theme="dark"] .ai-icon-gemini { background: rgba(59, 130, 246, 0.18); color: #60a5fa; border-color: rgba(96, 165, 250, 0.32); }

.ai-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; }
.ai-sub { font-size: 11px; color: var(--text-muted); }

.ai-prob-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ai-prob-label { font-size: 11.5px; color: var(--text-muted); }
.ai-prob-num {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
}
.ai-prob-num.low      { color: var(--green); }
.ai-prob-num.medium   { color: var(--amber); }
.ai-prob-num.high     { color: var(--orange); }
.ai-prob-num.critical { color: var(--red); }

.ai-meter {
  height: 7px;
  background: var(--surface-hover);
  border-radius: 99px;
  overflow: hidden;
}
.ai-meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.7s ease;
}
.ai-meter-fill.low      { background: var(--green); }
.ai-meter-fill.medium   { background: var(--amber); }
.ai-meter-fill.high     { background: var(--orange); }
.ai-meter-fill.critical { background: var(--red); }

.ai-meta-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
}
.ai-meta-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ai-meta-line span:first-child { color: var(--text-muted); }
.ai-meta-line span:last-child { font-weight: 600; text-align: right; }

.ai-factors {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-factor-item {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  padding-left: 8px;
  border-left: 2px solid var(--border-strong);
}
.ai-factor-item.critical { border-left-color: var(--red); }
.ai-factor-item.danger   { border-left-color: var(--orange); }
.ai-factor-item.warn     { border-left-color: var(--amber); }
.ai-factor-weight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--red);
  margin-right: 4px;
}
.ai-factor-item.warn .ai-factor-weight { color: var(--amber); }

.ai-disclaimer {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: -6px;
}

/* ============================================================================
   场景化修复建议 & 自然导流卡片（克制高信任风）
   ============================================================================ */
.fix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 20px;
  align-items: center;
}
.fix-card.sev-critical {
  background: linear-gradient(135deg, var(--surface) 0%, var(--red-soft) 100%);
  border-color: var(--red-border);
}
.fix-card.sev-danger {
  background: linear-gradient(135deg, var(--surface) 0%, var(--orange-soft) 100%);
  border-color: var(--orange-border);
}
.fix-card.sev-warn {
  background: linear-gradient(135deg, var(--surface) 0%, var(--amber-soft) 100%);
  border-color: var(--amber-border);
}
.fix-card.sev-info {
  background: linear-gradient(135deg, var(--surface) 0%, var(--brand-soft) 100%);
  border-color: var(--brand-border);
}

.fix-title {
  font-size: 15px;
  font-weight: 700;
  margin: 8px 0 6px;
  color: var(--text);
}
.fix-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 10px;
}
.fix-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fix-cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.fix-partner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.fix-partner-name { font-weight: 700; color: var(--text); }
.fix-trial-note { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.fix-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  font-size: 13px;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.fix-cta-btn:hover {
  background: var(--brand-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.fix-disclaimer {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================================
   双栈 IPv4/IPv6 + 多源分流总览
   ============================================================================ */
.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kv-list {
  display: flex;
  flex-direction: column;
}
.kv-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kv-row:last-child { border-bottom: none; padding-bottom: 0; }
.kv-row:first-child { padding-top: 0; }
.kv-key {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 104px;
  font-size: 12.5px;
}
.kv-val {
  color: var(--text);
  text-align: right;
  word-break: break-word;
  font-weight: 500;
}
.kv-val.mono { font-size: 12.5px; }
.kv-val.fail { color: var(--red); font-weight: 650; }
.kv-val.warn { color: var(--amber); font-weight: 650; }

.ip-big {
  font-family: var(--font-mono);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 6 段风控条（参考 ping0 清晰直观） */
.risk-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  width: 220px;
  max-width: 100%;
  margin-left: auto;
}
.risk-seg {
  height: 20px;
  border-radius: 4px;
  opacity: 0.22;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.risk-seg.active {
  opacity: 1;
  grid-column: span 2;
  padding: 0 6px;
}
.risk-c1 { background: #059669; }
.risk-c2 { background: #16a34a; }
.risk-c3 { background: #84cc16; color: #1a2e05; }
.risk-c4 { background: #eab308; color: #422006; }
.risk-c5 { background: #f97316; }
.risk-c6 { background: #dc2626; }

/* 4 源分流矩阵 */
.split-4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.split-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}
.split-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.split-tile-name { font-weight: 650; font-size: 13px; }
.split-tile-ip {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-all;
}
.split-tile-meta { font-size: 11.5px; color: var(--text-muted); }

/* ============================================================================
   10 大详细检测卡片网格
   ============================================================================ */
.cards-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.conn-group-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 7px;
}
.conn-group-title:first-child { margin-top: 0; }

.conn-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.conn-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}
.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.conn-dot.ok   { background: var(--green); }
.conn-dot.slow { background: var(--amber); }
.conn-dot.fail { background: var(--red); }
.conn-ms { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.conn-ms.ok   { color: var(--green); }
.conn-ms.slow { color: var(--amber); }
.conn-ms.fail { color: var(--red); }

/* 列表型行（DNS 解析器、多出口等） */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12.5px;
}
.mini-row.highlight-warn {
  background: var(--amber-soft);
  border-color: var(--amber-border);
}
.mini-row.highlight-danger {
  background: var(--red-soft);
  border-color: var(--red-border);
}

/* API 徽章网格 */
.api-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.api-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}
.api-pill.yes { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }
.api-pill.no  { opacity: 0.55; text-decoration: line-through; }

/* 表格样式（分流 / CDN / STUN / IP 洞察） */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-subtle); }

/* IP 洞察搜索栏 */
.search-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-input {
  flex: 1;
  min-width: 240px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.quick-ips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.quick-ip-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 99px;
  cursor: pointer;
}
.quick-ip-btn:hover { border-color: var(--brand); color: var(--brand); }

/* AI 深度说明指南 */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.guide-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.guide-box h3 { margin: 0 0 8px; font-size: 14px; }
.guide-box p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }

/* 页脚 */
.footer {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.footer-partner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

/* 弹窗（快照对比 Diff） */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* 轻提示 Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #0f172a;
  color: #fff;
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 骨架加载态 */
.skeleton {
  display: inline-block;
  height: 13px;
  width: 110px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--border) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================================
   扩展组件：欢迎回来复测条 / AI 生态条 / 终端 CLI 核验 / 战报预览 / FAQ
   ============================================================================ */
.return-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.return-banner.visible { display: flex; }

.eco-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.eco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.eco-name { font-weight: 700; font-size: 13px; }
.eco-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }

.cli-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: center;
}
.cli-cmd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px 8px 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
}
.cli-cmd-text {
  flex: 1;
  white-space: nowrap;
  user-select: all;
}
.cli-result-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.cli-result-box.match { background: var(--green-soft); border-color: var(--green-border); }
.cli-result-box.mismatch { background: var(--red-soft); border-color: var(--red-border); }

.poster-preview-wrap {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  margin-bottom: 14px;
}
.poster-preview-wrap img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  box-shadow: var(--shadow-sm);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.faq-item summary {
  font-weight: 650;
  font-size: 13.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 16px;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  margin: 10px 0 2px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.map-frame-wrap {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}
.map-frame {
  width: 100%;
  height: 280px;
  border: 0;
  display: block;
}
.magnet-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  word-break: break-all;
}
.geo-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.geo-stat-box {
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.geo-stat-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; }
.geo-stat-val { font-family: var(--font-mono); font-size: 13px; font-weight: 650; }

/* 多跳链路可视化 & 静默媒体权限矩阵 */
.hop-chain {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.hop-node {
  position: relative;
  padding: 10px 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
}
.hop-node.warn { background: var(--amber-soft); border-color: var(--amber-border); }
.hop-node.danger { background: var(--red-soft); border-color: var(--red-border); }
.hop-node-step { font-size: 10.5px; color: var(--text-muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.03em; }
.hop-node-val { font-weight: 700; margin-top: 3px; color: var(--text); word-break: break-word; }

.rtt-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.rtt-cell {
  padding: 8px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  text-align: center;
}
.rtt-cell b { display: block; font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.rtt-cell span { font-size: 11px; color: var(--text-muted); }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.perm-tile {
  padding: 9px 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.perm-tile.granted { background: var(--red-soft); border-color: var(--red-border); }
.perm-tile.denied  { background: var(--green-soft); border-color: var(--green-border); }
.perm-name { font-size: 12px; font-weight: 650; color: var(--text); }
.perm-state { font-size: 11px; font-weight: 600; }

.active-test-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

/* ============================================================================
   首屏全宽总览 Banner（左右严格等高对齐，彻底消除窄栏割裂感）
   ============================================================================ */
.overview-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 326px 1fr;
  overflow: hidden;
  margin-bottom: 18px;
}

.overview-score-col {
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-subtle) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overview-anomaly-col {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.anomaly-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 2px;
  align-content: start;
}
.anomaly-list .anomaly-empty {
  grid-column: 1 / -1;
}

.dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.dual-grid > .card {
  display: flex;
  flex-direction: column;
}
.dual-grid > .card > .card-body {
  flex: 1;
}

.conn-chips-3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.speed-box {
  margin-top: 12px;
  padding: 11px 13px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.bgp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.bgp-cell {
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.bgp-cell span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.bgp-cell b { font-family: var(--font-mono); font-size: 13.5px; color: var(--text); word-break: break-word; }

/* ============================================================================
   响应式全端适配（桌面 ≥1080px · iPad 横竖屏 768–1080px · 手机 360–640px）
   ============================================================================ */
@media (max-width: 1120px) {
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav-tabs { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .nav-tab { flex-shrink: 0; }
}

@media (max-width: 1040px) {
  /* iPad 横屏与竖屏：总览横条优化为上下结构，上方评分+统计水平排布，下方保留 2 列异常网格 */
  .overview-banner { grid-template-columns: 1fr; }
  .overview-score-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
  }
  .overview-score-col > div:first-child {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 16px;
    align-items: center;
  }
  .overview-score-col .score-ring-wrap { margin-bottom: 0; }
  .overview-score-col .score-stats-row { margin-bottom: 0; }
  .overview-score-col .diff-ribbon { margin-top: 12px; }

  .hero-grid { grid-template-columns: 1fr; }
  .ai-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fix-card, .cli-box { grid-template-columns: 1fr; gap: 14px; }
  .split-4-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eco-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hop-chain, .rtt-strip, .bgp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  /* iPad 竖屏：双栏大卡切为舒适单列，每张卡满宽通透 */
  .dual-grid, .cards-grid-2, .guide-grid { grid-template-columns: 1fr; }
  .section-heading { flex-direction: column; gap: 3px; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .status-right { width: 100%; }
  .progress-track { flex: 1; width: auto; }
}

@media (max-width: 680px) {
  /* 手机端核心断点（iPhone / Android 360px–680px） */
  .container { padding: 0 14px; }
  .main-wrap { padding: 14px 0 42px; }
  .overview-score-col > div:first-child { grid-template-columns: 1fr; gap: 12px; }
  .overview-score-col, .overview-anomaly-col { padding: 15px 16px; }
  .anomaly-list { grid-template-columns: 1fr; max-height: none; overflow-y: visible; }
  .ai-cards-grid { grid-template-columns: 1fr; }
  .conn-chips, .conn-chips-3 { grid-template-columns: 1fr; }
  .eco-grid, .geo-stat-grid, .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-head, .card-body { padding: 13px 14px; }
  .search-input { font-size: 16px; min-width: 0; width: 100%; } /* 防止 iOS Safari 聚焦放大 */
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }
  .modal-backdrop { padding: 12px; }
  .modal-card { max-height: 90dvh; }
  .footer-partner { flex-direction: column; align-items: stretch; }
  .footer-partner .btn { width: 100%; }
}

@media (max-width: 540px) {
  /* 窄屏手机（iPhone SE / iPhone 15 375–430px）：键值对改为上下排布杜绝文字竖排挤压 */
  .kv-row {
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 8px 0;
  }
  .kv-key { font-size: 11.5px; min-width: 0; }
  .kv-val { text-align: left; font-size: 13px; justify-content: flex-start !important; }
  .risk-bar { margin-left: 0; width: 100%; max-width: 280px; }
  .split-4-grid { grid-template-columns: 1fr; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .hide-sm { display: none; }
  .btn { height: 34px; padding: 0 10px; font-size: 12.5px; }
  .brand-name { font-size: 15.5px; }
  .ip-big { font-size: 15px; }
  .active-test-row .btn { flex: 1 1 calc(50% - 4px); }
}

@media (max-width: 420px) {
  .brand-logo { width: 26px; height: 26px; border-radius: 7px; }
  .brand-name { font-size: 14.5px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { height: 32px; padding: 0 8px; font-size: 12px; }
  .topbar-actions .btn-icon { width: 32px; padding: 0; }
}

@media (max-width: 390px) {
  .eco-grid, .perm-grid, .geo-stat-grid { grid-template-columns: 1fr; }
}
