/* ========== 主题 ========== */
:root {
  --bg: #f4f6fb;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --surface: rgba(255, 255, 255, 0.78);
  --surface-hover: rgba(255, 255, 255, 0.95);
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-bg-hover: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 32px -14px rgba(15, 23, 42, 0.28);
  --accent-1: #6366f1;
  --accent-2: #06b6d4;
  --accent: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --yes: #16a34a;
  --yes-soft: rgba(22, 163, 74, 0.12);
  --partial: #d97706;
  --partial-soft: rgba(217, 119, 6, 0.13);
  --no: #dc2626;
  --no-soft: rgba(220, 38, 38, 0.11);
  --idle: #64748b;
  --idle-soft: rgba(100, 116, 139, 0.12);
  --risk: #ea580c;
  --risk-soft: rgba(234, 88, 12, 0.12);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.12);
  --blob-1: rgba(99, 102, 241, 0.28);
  --blob-2: rgba(6, 182, 212, 0.22);
  --blob-3: rgba(236, 72, 153, 0.16);
  --radius: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07090f;
  --bg-elevated: rgba(17, 21, 31, 0.7);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(22, 26, 36, 0.62);
  --card-bg-hover: rgba(30, 35, 48, 0.78);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eef2f8;
  --text-soft: #c8d0dc;
  --muted: #8a94a6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  --accent: #818cf8;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --yes: #4ade80;
  --yes-soft: rgba(74, 222, 128, 0.12);
  --partial: #fbbf24;
  --partial-soft: rgba(251, 191, 36, 0.13);
  --no: #f87171;
  --no-soft: rgba(248, 113, 113, 0.12);
  --idle: #8a94a6;
  --idle-soft: rgba(138, 148, 166, 0.12);
  --risk: #fb923c;
  --risk-soft: rgba(251, 146, 60, 0.13);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.13);
  --blob-1: rgba(99, 102, 241, 0.32);
  --blob-2: rgba(6, 182, 212, 0.2);
  --blob-3: rgba(236, 72, 153, 0.16);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07090f;
    --bg-elevated: rgba(17, 21, 31, 0.7);
    --surface: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --card-bg: rgba(22, 26, 36, 0.62);
    --card-bg-hover: rgba(30, 35, 48, 0.78);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #eef2f8;
    --text-soft: #c8d0dc;
    --muted: #8a94a6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 40px -16px rgba(0, 0, 0, 0.8);
    --accent: #818cf8;
    --accent-soft: rgba(129, 140, 248, 0.14);
    --yes: #4ade80;
    --yes-soft: rgba(74, 222, 128, 0.12);
    --partial: #fbbf24;
    --partial-soft: rgba(251, 191, 36, 0.13);
    --no: #f87171;
    --no-soft: rgba(248, 113, 113, 0.12);
    --idle: #8a94a6;
    --idle-soft: rgba(138, 148, 166, 0.12);
    --risk: #fb923c;
    --risk-soft: rgba(251, 146, 60, 0.13);
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, 0.13);
    --blob-1: rgba(99, 102, 241, 0.32);
    --blob-2: rgba(6, 182, 212, 0.2);
    --blob-3: rgba(236, 72, 153, 0.16);
    color-scheme: dark;
  }
}

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

.flag {
  display: inline-block;
  width: 18px;
  height: 13.5px;
  margin-right: 5px;
  border-radius: 2.5px;
  object-fit: cover;
  vertical-align: -2px;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.region-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

button { font: inherit; color: inherit; }
svg { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); }

.page {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

/* ========== 背景极光 ========== */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.9;
  will-change: transform;
}
.blob-1 { background: var(--blob-1); top: -18vmax; left: -10vmax; animation: drift-1 26s ease-in-out infinite alternate; }
.blob-2 { background: var(--blob-2); top: -12vmax; right: -16vmax; animation: drift-2 30s ease-in-out infinite alternate; }
.blob-3 { background: var(--blob-3); top: 30vh; left: 30vw; width: 34vmax; height: 34vmax; animation: drift-3 34s ease-in-out infinite alternate; }

@keyframes drift-1 { to { transform: translate(14vw, 10vh) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-12vw, 14vh) scale(0.9); } }
@keyframes drift-3 { to { transform: translate(-18vw, -8vh) scale(1.2); } }

/* ========== 顶栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px; }
.brand-mark {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(99, 102, 241, 0.45));
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s;
}
.icon-button:hover { background: var(--surface-hover); transform: rotate(-12deg); }
/* 页面固定文字是中文，英文界面在 lib/i18n.js 填好文字前先隐藏 */
html[lang="en"]:not(.i18n-ready) .page { visibility: hidden; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang-button {
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s;
}
.lang-button:hover { background: var(--surface-hover); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-moon { display: none !important; }
:root[data-theme="dark"] .icon-sun { display: none !important; }
:root[data-theme="dark"] .icon-moon { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none !important; }
  :root:not([data-theme="light"]) .icon-moon { display: block !important; }
}

/* ========== 首屏 ========== */
.hero { animation: rise 0.7s var(--ease-out) both; }
.hero-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.gradient-text {
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2) 55%, #ec4899);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.hero-subtitle { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

.hero-cards {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.15fr;
  gap: 14px;
  margin-top: 26px;
}

.panel {
  position: relative;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
  animation: rise 0.7s var(--ease-out) both;
}
.panel:nth-child(2) { animation-delay: 0.06s; }
.panel:nth-child(3) { animation-delay: 0.12s; }
.panel-label { font-size: 12.5px; color: var(--muted); letter-spacing: 0.3px; }
.panel-meta { margin-top: 2px; font-size: 13px; color: var(--muted); min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-meta .flag { margin-right: 4px; }

.ip-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ip-value .flag { font-size: 20px; }
.ip-value .ip-family {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}

.skeleton-text {
  display: inline-block;
  color: transparent;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--idle-soft), var(--border-strong), var(--idle-soft));
  background-size: 200% 100%;
  animation: shimmer-bg 1.4s linear infinite;
}
@keyframes shimmer-bg { to { background-position: -200% 0; } }

.ext-value { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 20px; font-weight: 700; }
.ext-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; }
.ext-panel[data-ext="connected"] .ext-dot { background: var(--yes); box-shadow: 0 0 0 0 var(--yes); animation: beacon 2.4s ease-out infinite; }
.ext-panel[data-ext="missing"] .ext-dot,
.ext-panel[data-ext="outdated"] .ext-dot { background: var(--partial); }
@keyframes beacon {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--yes) 60%, transparent); }
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}

.link-button {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.summary-panel { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 68px; height: 68px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: var(--idle-soft); }
.ring-bar {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 169.65;
  stroke-dashoffset: 169.65;
  transition: stroke-dashoffset 0.6s var(--ease-out), stroke 0.4s;
}
body[data-state="done"] .ring-bar { stroke: var(--yes); }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; flex: 1; }
.stat { display: flex; flex-direction: column; align-items: flex-start; }
.stat b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat-yes b { color: var(--yes); }
.stat-no b { color: var(--no); }
.stat-other b { color: var(--risk); }
.stat b.bump { animation: bump 0.35s var(--ease-spring); }
@keyframes bump { 50% { transform: scale(1.25); } }

.install-guide {
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  animation: rise 0.4s var(--ease-out) both;
}
.install-guide h3 { margin: 0 0 6px; font-size: 15px; }
.install-guide ol { margin: 0; padding-left: 20px; color: var(--text-soft); }
.install-guide li { margin: 3px 0; }
.install-guide p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.install-guide a { color: var(--accent); }
.install-guide a.install-store { display: inline-flex; color: #fff; text-decoration: none; }
/* 按浏览器显示安装方式：Edge 显示商店按钮，其他浏览器显示手动安装步骤（html[data-browser] 由 app.js 设置） */
html[data-browser="edge"] .install-guide [data-browser="other"],
html:not([data-browser="edge"]) .install-guide [data-browser="edge"] { display: none; }

/* ========== 标签页 ========== */
.tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  margin: 32px 0 14px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
}
.tab {
  position: relative;
  z-index: 1;
  padding: 8px 18px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: #fff; }
.tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.8);
  transition: transform 0.45s var(--ease-spring), width 0.45s var(--ease-spring);
}

/* ========== 工具栏 ========== */
.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.toolbar-filters { flex: 1; min-width: 0; }
.toolbar-actions { display: flex; gap: 8px; flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), background 0.2s, border-color 0.2s, color 0.2s;
}
.chip:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.chip-count { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-count { color: inherit; opacity: 0.8; }

.all-filters { display: flex; flex-direction: column; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font: inherit; }

.view-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.view-hint:empty { display: none; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, opacity 0.2s, background 0.2s;
}
.button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button:disabled { opacity: 0.45; cursor: default; }
.button:not(:disabled):active { transform: scale(0.97); }
.button-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.75);
}
.button-primary:not(:disabled):hover { box-shadow: 0 12px 26px -8px rgba(99, 102, 241, 0.9); transform: translateY(-1px); }
body[data-state="running"] .button-primary svg { animation: spin 0.9s linear infinite; }
/* 打开网页后不自动检测：“开始检测”按钮显示播放图标并轻微呼吸，提示从这里开始 */
#run .icon-play { display: none; }
body[data-started="false"] #run .icon-play { display: block; fill: currentColor; stroke: none; }
body[data-started="false"] #run .icon-refresh { display: none; }
body[data-started="false"] #run:not(:disabled) { animation: start-pulse 2.2s ease-in-out infinite; }
@keyframes start-pulse {
  0%, 100% { box-shadow: 0 8px 22px -10px rgba(99, 102, 241, 0.8), 0 0 0 0 rgba(99, 102, 241, 0.45); }
  50% { box-shadow: 0 8px 22px -10px rgba(99, 102, 241, 0.8), 0 0 0 8px rgba(99, 102, 241, 0); }
}
@media (prefers-reduced-motion: reduce) { body[data-started="false"] #run:not(:disabled) { animation: none; } }
.button-ghost { border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); }
.button-ghost:not(:disabled):hover { background: var(--surface-hover); }
.button-warn { color: var(--no); border-color: color-mix(in srgb, var(--no) 35%, var(--border)); animation: pop 0.3s var(--ease-out); }
.button-warn:not(:disabled):hover { background: var(--no-soft); }
.button-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--no-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ========== 平台网格 ========== */
.board { min-height: 300px; }
.group { margin-bottom: 26px; }
.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.3px;
}
.group-title .group-count { font-size: 12px; font-weight: 600; color: var(--muted); }
.group-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 12px;
}

.card {
  --status: var(--idle);
  --status-soft: var(--idle-soft);
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: default;
  animation: card-in 0.55s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.35s, background 0.25s;
}
.card[data-runnable="true"] { cursor: pointer; }
.card[data-runnable="true"]:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--card-bg-hover); }

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--status);
  opacity: 0;
  transition: opacity 0.35s, background 0.35s;
}
.card:is([data-status="yes"], [data-status="partial"], [data-status="no"], [data-status="risk"], [data-status="neterr"], [data-status="info"]) { border-color: color-mix(in srgb, var(--status) 28%, var(--border)); }
.card:is([data-status="yes"], [data-status="partial"], [data-status="no"], [data-status="risk"], [data-status="neterr"], [data-status="info"])::before { opacity: 1; }

.card[data-status="yes"] { --status: var(--yes); --status-soft: var(--yes-soft); }
.card[data-status="partial"] { --status: var(--partial); --status-soft: var(--partial-soft); }
.card:is([data-status="no"], [data-status="neterr"]) { --status: var(--no); --status-soft: var(--no-soft); }
.card[data-status="risk"] { --status: var(--risk); --status-soft: var(--risk-soft); }
.card[data-status="info"] { --status: var(--info); --status-soft: var(--info-soft); }
.card:is([data-status="running"], [data-status="queued"]) { --status: var(--accent); --status-soft: var(--accent-soft); }
.card[data-retry="true"] { --status: var(--risk); --status-soft: var(--risk-soft); }

.card:is([data-status="unported"], [data-status="legacy"], [data-status="needs-extension"]) { opacity: 0.55; }
.card:is([data-status="unported"], [data-status="legacy"], [data-status="needs-extension"]) .card-logo { filter: grayscale(0.85); }
/* 没有匿名地区门禁：结论已知但无法检测，弱化显示 */
.card:is([data-status="account"], [data-status="nogate"]) { opacity: 0.72; }
.card:is([data-status="account"], [data-status="nogate"]) .card-logo { filter: grayscale(0.6); }

.card-logo {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 4px 10px -4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  grid-row: 1;
  transition: filter 0.3s;
}
.card-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-logo .monogram {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.5px;
}

.card[data-status="running"] .card-logo { animation: logo-pulse 1.2s ease-in-out infinite; }
@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--border), 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  50% { box-shadow: 0 0 0 1px var(--border), 0 0 0 7px transparent; }
}

.card-main { min-width: 0; }
.card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
}
.card-meta { font-size: 12px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--status);
  background: var(--status-soft);
}
.badge .spinner {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.card.revealed .badge { animation: pop 0.5s var(--ease-spring); }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.card-detail {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.card-detail .result-text {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-detail .region-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--idle-soft);
}
.card-detail .region-label { flex: none; font-size: 12px; color: var(--text-soft); margin-right: -4px; }
.card-detail .elapsed { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 11.5px; }

/* 卡片底部的 CDN 首选节点 */
.card-cdn {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}
.card-cdn:empty { display: none; }
.card-cdn .cdn-label { flex: none; }
.card-cdn .cdn-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-soft);
}
.card-cdn .cdn-pending { font-weight: 500; color: var(--muted); }
.card-cdn .cdn-failed { font-weight: 500; color: var(--no); }
.card-cdn .flag { width: 16px; height: 12px; margin-right: 5px; }

/* 检测中：扫光 */
.card[data-status="running"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, var(--accent) 16%, transparent) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sweep 1.3s linear infinite;
  pointer-events: none;
}
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* 出结果：按结果颜色闪光 */
.card.revealed { animation: glow 1.1s var(--ease-out); animation-delay: 0s; }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status) 55%, transparent), var(--shadow); }
  100% { box-shadow: 0 0 0 14px transparent, var(--shadow); }
}

@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.card:is([data-status="unported"], [data-status="legacy"], [data-status="needs-extension"]) { animation-name: card-in-dim; }
@keyframes card-in-dim { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 0.55; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  animation: rise 0.4s var(--ease-out) both;
}

.footer { margin-top: 40px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ========== 提示 ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .hero-cards { grid-template-columns: 1fr 1fr; }
  .summary-panel { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .page { padding: 14px 16px 36px; }
  .topbar { margin-bottom: 20px; }
  .hero-subtitle { font-size: 14.5px; }
  .hero-cards { grid-template-columns: 1fr; gap: 10px; }
  .tabs { display: flex; margin-top: 24px; }
  .tab { flex: 1; padding: 8px 6px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-end; flex-wrap: wrap; }
  .toolbar-actions .button { flex: 1; justify-content: center; }
  .toolbar-actions #retry-failed { flex-basis: 100%; }
  #region-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  #region-chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .search { max-width: none; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .blob { animation: none; }
}
