/* ============================================================
   NetProbe — 仪表盘
   调色板取自已验证的数据可视化色板；分类色按固定顺序使用，不循环。
   ============================================================ */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/v/a9cb1cd82332/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/v/c503cc5ec5f8/assets/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* 主题三态：
   - data-theme="dark" / "light"  → 用户显式选择，必须压过系统设置
   - 无 data-theme                → 跟随系统，由 prefers-color-scheme 决定
   深色是基准（工具面板长时间盯着看），浅色作为一整套 token 覆盖，
   分类色两档都取自已验证的色板，不是把深色档直接调亮。 */

:root {
  color-scheme: dark;

  --bg: #0e1013;
  --surface-1: #16181c;
  --surface-2: #1c1f25;
  --surface-3: #232830;
  --border: #282d36;
  --border-strong: #3a414d;

  --text-1: #f2f4f7;
  --text-2: #a8b0bc;
  --text-3: #6d7684;

  /* 分类色（深色档，固定顺序，禁止循环使用） */
  --c1: #3987e5;
  --c2: #d95926;
  --c3: #199e70;
  --c4: #c98500;
  --c5: #d55181;
  --c6: #008300;
  --c7: #9085e9;
  --c8: #e66767;

  /* 状态色（保留槽位，永不当作分类色） */
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --accent: var(--c1);
  --done-bg: #238636; --done-border: #2ea043; --done-flash: #3fb950;
  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 3400px;   /* 4K 下不再把内容框死在中间一条 */

  /* 等宽栈必须自带中文托底。
     CSS 的字体回退是逐字符生效的：拉丁字符命中 JetBrains Mono，中文在它这里
     找不到字形就继续往后找。若最后只落到泛型 monospace，Windows/Chrome 会把
     中文映射成宋体——一个衬线体，混在等宽界面里非常扎眼。
     所以在泛型之前依次排：中文等宽（装了才有）→ 中文黑体（几乎必有）。
     中文本身是等宽的，用黑体托底在等宽语境里完全不违和。 */
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Sarasa Mono SC", "Noto Sans Mono CJK SC", "Source Han Mono SC",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei",
    monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei",
    sans-serif;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .28);
}

/* 浅色 token 集中在这里定义一次，下面两个作用域各引用一遍。 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f5f7;
    --surface-1: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #eceff3;
    --border: #dfe3e9;
    --border-strong: #bfc7d2;
    --text-1: #12161c;
    --text-2: #4d5561;
    --text-3: #79828f;
    --c1: #2a78d6;
    --c2: #eb6834;
    --c3: #1baf7a;
    --c4: #eda100;
    --c5: #e87ba4;
    --c6: #008300;
    --c7: #4a3aa7;
    --c8: #e34948;
    --done-bg: #1f883d; --done-border: #1a7f37; --done-flash: #2da44e;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .08);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface-1: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eceff3;
  --border: #dfe3e9;
  --border-strong: #bfc7d2;
  --text-1: #12161c;
  --text-2: #4d5561;
  --text-3: #79828f;
  --c1: #2a78d6;
  --c2: #eb6834;
  --c3: #1baf7a;
  --c4: #eda100;
  --c5: #e87ba4;
  --c6: #008300;
  --c7: #4a3aa7;
  --c8: #e34948;
  --done-bg: #1f883d; --done-border: #1a7f37; --done-flash: #2da44e;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .08);
}


* { box-sizing: border-box; margin: 0; padding: 0; }

/* 字号基准整体下调一档：这是信息密集型的工具面板，不是阅读型页面。
   所有尺寸用 rem，改这一处即可整体缩放。
   不用 vw：窗口一变窄字号就跟着塌，正是老版本的毛病。 */
html {
  font-size: 13px;
  -webkit-text-size-adjust: 100%;
}
/* 4K：在 100%~150% 缩放下 CSS 宽度常在 2560 以上，稍放大一点保证可读 */
@media (min-width: 2400px) { html { font-size: 14px; } }
/* 4K 100% 缩放（CSS 宽 3840）：像素本身很小，再放大一档 */
@media (min-width: 3200px) { html { font-size: 15px; } }
/* 手机：触控目标需要更大的字 */
@media (max-width: 700px)  { html { font-size: 14px; } }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

code, kbd, pre, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
@media (max-width: 700px) { .wrap { padding: 0 12px; } }

[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 14px;
  height: 48px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 22px; height: 22px; border-radius: 5px; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--text-3); letter-spacing: .04em; line-height: 1.2; }
.topbar .spacer { flex: 1; }
.topbar .meta { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.topbar .meta b { color: var(--text-2); font-weight: 400; }

/* 迷你进度：检测进行中时出现在品牌旁边 */
.mini-progress {
  display: none; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .8rem; color: var(--text-2);
  padding: 3px 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
body.running .mini-progress { display: inline-flex; }

/* 顶栏底边的不确定进度条：只要还在跑，它就一直在动 */
.topbar-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
.topbar-bar i {
  display: none; position: absolute; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.4s ease-in-out infinite;
}
body.running .topbar-bar i { display: block; }
@keyframes slide { from { left: -30%; } to { left: 100%; } }

.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer;
  font-size: .9rem;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text-1); }

.spinner {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 控制台 ---------------- */

.console { padding: 16px 0 4px; }
.console-inner {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.console-row { display: flex; gap: 10px 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.grow { flex: 1 1 380px; min-width: 240px; }
.field label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.num-in { width: 84px; }

input[type="text"], input[type="number"], select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: .95rem;
  padding: 7px 10px;
  height: 34px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
input::placeholder { color: var(--text-3); }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.btn {
  height: 34px; padding: 0 18px;
  background: var(--accent); color: #fff;
  border: 0; border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .95rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 三个开关和输入框同一行，省掉一整行高度 */
.toggles { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; align-self: center; padding-top: 16px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.toggle:hover { color: var(--text-1); }

/* 全局复选框：不用系统默认样式。appearance:none 后仍是原生 <input>，
   键盘、表单提交、无障碍语义全都保留，只换外观。
   勾号用 mask 而不是背景图，这样颜色跟着 token 走，深浅主题都对。 */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  position: relative; display: inline-grid; place-items: center;
  width: 16px; height: 16px; border-radius: 4px; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid var(--border-strong);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
input[type="checkbox"]::after {
  content: ""; width: 10px; height: 10px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: scale(0); transition: transform .15s cubic-bezier(.3, 1.6, .6, 1);
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { transform: scale(1); }
input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }
.toggle:has(input:checked) { color: var(--text-1); }
@media (forced-colors: active) { input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; } input[type="checkbox"]::after { display: none; } }

/* ---------------- 任务面板 ---------------- */

.tasks { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.tasks-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tasks-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tasks-fill {
  height: 100%; width: 0; border-radius: 3px;
  background-color: var(--accent);
  transition: width .4s ease;
}
/* 进行中时条纹持续流动：哪怕这一刻没有新的任务完成，也看得出它活着 */
body.running .tasks-fill {
  background-image: linear-gradient(45deg,
    rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%,
    rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%);
  background-size: 16px 16px;
  animation: stripes .6s linear infinite;
  min-width: 6%;
}
@keyframes stripes { to { background-position: 16px 0; } }
.tasks-count { font-size: .85rem; color: var(--text-2); }
.tasks-clock { font-size: .85rem; color: var(--text-1); font-weight: 700; min-width: 4.5em; text-align: right; }

.task-list {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px;
}
.task {
  display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .85rem; color: var(--text-2);
  transition: border-color .25s, background .25s;
}
.task .ico { display: grid; place-items: center; width: 16px; height: 16px; font-size: .85rem; line-height: 1; }
.task .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .tm { font-family: var(--mono); font-size: .78rem; color: var(--text-3); }
.task.run { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text-1); }
.task.run .tm { color: var(--accent); }
/* 完成态用实色绿底 + 白字。状态色 --good 在深色档偏暗，按 22% 混进深灰底后
   只剩一层发闷的墨绿；这里单独取一档饱和、明度足够的绿，白字对比度 ≥ 4.5。 */
.task.ok {
  background: var(--done-bg); border-color: var(--done-border); color: #fff;
  animation: flash .6s ease-out;
}
.task.ok .ico, .task.ok .tm { color: rgba(255, 255, 255, .9); }
.task.fail .ico, .task.fail .tm { color: var(--critical); }
.task.skip { opacity: .45; }
.task.slow .tm { color: var(--warn); }
/* 手机：两列紧凑排；结束后只留失败项，其余由顶部那行汇总代替 */
@media (max-width: 700px) {
  .task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .task { grid-template-columns: 14px 1fr auto; gap: 6px; padding: 4px 7px; font-size: .8rem; }
  .tasks.finished .task:not(.fail) { display: none; }
  .tasks.finished .tasks-head { margin-bottom: 0; }
  .tasks.finished .task-list:has(.fail) { margin-top: 8px; }
}
/* 刚完成的那一下先亮一档再落到实色，让「这一项刚好」被看见 */
@keyframes flash {
  from { background: var(--done-flash); }
  to   { background: var(--done-bg); }
}

.banner {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent);
  background: color-mix(in srgb, var(--critical) 12%, transparent);
  color: var(--text-1); font-size: .9rem; display: none;
}
.banner.on { display: block; }

/* ---------------- 首屏（尚未检测） ----------------
   html.idle：页面第一次打开、还没跑过任何检测。此时没有结果可看，
   工作台式的紧凑布局只剩一条输入框，显得空。改成居中的落地页：
   标题 → 大输入框 → 最近检测（卡片）→ 能查什么。一开始检测就收起。
   idle 类由 boot.js 在 <head> 里挂到 <html> 上，首帧就是首屏布局。 */

/* 界面文案由 app.js 注入。脚本到达前内容区先透明（布局照常占位），
   就绪后淡入，免得慢网下先看到一排空标签和空按钮。
   4 秒兜底：万一脚本加载失败，也不能让页面永远是空白。 */
.page-main { transition: opacity .25s ease-out; }
html:not(.ready) .page-main { opacity: 0; animation: np-reveal 0s 4s forwards; }
@keyframes np-reveal { to { opacity: 1; } }

.hero, .landing { display: none; }
html.idle body .hero, html.idle body .landing { display: block; }
html.idle body main, html.idle body .page-side, html.idle body .lower { display: none !important; }
html.idle body .page { display: block; }
html.idle body .page-main { max-width: 1080px; margin: 0 auto; }

/* 背景：一层淡淡的点阵 + 顶部一团主色光，往下渐隐 */
html.idle body { background:
  radial-gradient(900px 420px at 50% -80px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
  var(--bg); }
html.idle body::before {
  content: ""; position: absolute; inset: 49px 0 auto 0; height: 560px; pointer-events: none; z-index: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text-3) 38%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 75%);
}
html.idle body .page { position: relative; z-index: 1; }

.hero { text-align: center; padding: clamp(40px, 9vh, 110px) 0 26px; }
.hero-eyebrow { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.hero-eyebrow span {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--text-2);
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-1) 70%, transparent);
}
.hero-title {
  font-size: clamp(1.9rem, 3.2vw, 3rem); line-height: 1.15; font-weight: 750; letter-spacing: -.025em;
  color: var(--text-1); margin-bottom: 14px; text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent), var(--c7));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 640px; margin: 0 auto; color: var(--text-2); font-size: 1.05rem; line-height: 1.65; text-wrap: pretty; }

/* 控制台在首屏变成一个大搜索框：输入框和按钮同一行，参数退到第二行 */
.row-break { display: none; }
/* 工作台布局里按钮仍排在整行最后；首屏里紧跟输入框，参数换到下一行 */
.go-field { order: 2; }
html.idle body .go-field { order: 0; }
html.idle body .row-break { order: 1; }
html.idle body .opt { order: 2; }
html.idle body .console { padding-top: 6px; }
html.idle body .console-inner { border-radius: 14px; padding: 14px; box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--accent) 6%, transparent); }
html.idle body .console-row { gap: 10px; }
html.idle body .field.grow > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.idle body #url {
  height: 50px; font-size: 1.12rem; padding-left: 44px; border-radius: 10px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2379828f' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 15px center / 18px;
}
html.idle body #go { height: 50px; padding: 0 26px; font-size: 1.02rem; border-radius: 10px; }
html.idle body .row-break { display: block; flex-basis: 100%; height: 1px; background: var(--border); margin: 4px 0 0; }
html.idle body .opt { flex-direction: row; align-items: center; gap: 8px; }
html.idle body .opt > label { font-size: .7rem; }
html.idle body .opt .num-in { width: 64px; height: 28px; padding: 3px 8px; font-size: .85rem; }
html.idle body .toggles { padding-top: 0; margin-left: auto; }
@media (max-width: 700px) {
  html.idle body .field.grow { flex-basis: 100%; }
  html.idle body .go-field { flex: 1; }
  html.idle body #go { width: 100%; justify-content: center; }
  html.idle body .toggles { margin-left: 0; }
}

.landing { padding: 26px 0 100px; }
.landing-block + .landing-block { margin-top: 34px; }
.landing-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.landing-head h2 { font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.landing-note { font-size: .78rem; color: var(--text-3); margin-left: auto; }
#recent-block.none .landing-head { display: none; }

.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rcard {
  position: relative; padding: 11px 13px 10px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  border-top: 3px solid var(--st, var(--border-strong));
  cursor: pointer; min-width: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.rcard.s-good { --st: var(--good); }
.rcard.s-warn { --st: var(--warn); }
.rcard.s-critical { --st: var(--critical); }
.rcard:hover { transform: translateY(-2px); border-color: var(--border-strong); border-top-color: var(--st); box-shadow: var(--shadow); }
.rcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; padding-right: 18px; }
.rc-top .badge { font-size: .72rem; }
.rc-top time { font-size: .75rem; color: var(--text-3); white-space: nowrap; }
.rc-host { font-family: var(--mono); font-size: .98rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-path { font-family: var(--mono); font-size: .78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.rcard .del { top: 9px; transform: none; }

.try { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: .88rem; color: var(--text-3); grid-column: 1 / -1; }
.try-chip {
  font-size: .85rem; color: var(--text-2); background: var(--surface-1); cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
}
.try-chip:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.feat {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 15px;
  background: color-mix(in srgb, var(--surface-1) 65%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.feat-ico {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.feat-ico svg { width: 18px; height: 18px; }
.feat b { display: block; font-size: .95rem; color: var(--text-1); margin-bottom: 3px; }
.feat p { font-size: .84rem; color: var(--text-3); line-height: 1.55; }
.feat:nth-child(2) .feat-ico { color: var(--c3); background: color-mix(in srgb, var(--c3) 12%, transparent); }
.feat:nth-child(3) .feat-ico { color: var(--c2); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.feat:nth-child(4) .feat-ico { color: var(--c7); background: color-mix(in srgb, var(--c7) 12%, transparent); }
.feat:nth-child(5) .feat-ico { color: var(--c4); background: color-mix(in srgb, var(--c4) 12%, transparent); }
.feat:nth-child(6) .feat-ico { color: var(--c5); background: color-mix(in srgb, var(--c5) 12%, transparent); }

/* ---------------- 主体 ---------------- */

main { padding: 14px 0 90px; }   /* 底部留白给右下角的留言按钮 */

/* 页面骨架：≥1920px 时右侧多一条历史侧栏，从输入框那一行起、滚动时吸顶。
   左侧内容区是一个尺寸容器，下面的瓦片和结果面板按「它自己的宽度」
   决定分几列：加了侧栏后左侧实际可用宽度比视口窄三四百像素，
   仍按视口断点判断会把三列硬塞进 1500px 里。 */
.page-main { container: main / inline-size; min-width: 0; }
.page-side { display: none; }
@media (min-width: 1920px) {
  .page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
  .page-side {
    /* 吸附在顶栏底边（48px），16px 间距由下面的 padding-top 提供。
       若写成 top: 64px，静止时侧栏的自然位置（49px）小于 64，sticky 会立刻
       把它往下推 15px，历史卡就比左边的输入框低了一截。 */
    display: block; position: sticky; top: 48px;
    padding-top: 16px; margin-top: 0;
  }
  .page-side #card-hist { max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
  .page-side .hist { max-height: none; flex: 1; min-height: 0; }
}
@media (min-width: 2560px) { .page { grid-template-columns: minmax(0, 1fr) 380px; } }

/* 概览瓦片：七个固定槽位，高度锁定，骨架与真实内容同高 → 填充时零位移 */
.tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@container main (max-width: 1360px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px)  {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 七块排两列会剩一块，让它（落地 IP）占满一行，IP 地址也就不会被截断 */
  .tiles > .tile:last-child { grid-column: span 2; }
}

.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 13px 11px;
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  height: 5.9rem;
}
.tile .k { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tile .v {
  font-family: var(--mono); font-size: 1.55rem; font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .n { font-size: .78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.good .v { color: var(--good); }
.tile.warn .v { color: var(--warn); }
.tile.critical .v { color: var(--critical); }
.tile.serious .v { color: var(--serious); }
.tile.na .v { color: var(--text-3); }
.tile.loading .v, .tile.loading .n { color: transparent; border-radius: 4px; }
.tile.loading .v { width: 55%; }
.tile.loading .n { width: 80%; }

/* 结果面板：按话题分列，列内按「通常谁先到」排。
   列是独立的 flex 栈，一张卡长高只推动同列下面的卡。 */
.board {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "a" "b" "c";
}
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-a { grid-area: a; }
.col-b { grid-area: b; }
.col-c { grid-area: c; }
/* 两列：连接与 DNS 叠在左边，安全/TLS 占右边整列 */
@container main (min-width: 1060px) {
  .board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "a b" "c b";
    grid-template-rows: auto 1fr;
  }
}
/* 三列：大屏和 4K，三类结果并排，一屏看完 */
@container main (min-width: 1700px) {
  .board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "a b c";
    grid-template-rows: auto;
  }
}

.lower { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container main (min-width: 1060px) { .lower { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
@container main (min-width: 1700px) { .lower { grid-template-columns: minmax(0, 1fr) minmax(0, 2.25fr); } }
/* 历史移到侧栏后，这里只剩原始数据，占满整行 */
.lower:not(:has(#card-hist)) { grid-template-columns: minmax(0, 1fr); }
.raws { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px 15px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card > h2 {
  font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 3px;
  display: flex; align-items: center; gap: 8px;
}
.card > h2 .badge { text-transform: none; letter-spacing: 0; }
.card > .sub { font-size: .85rem; color: var(--text-3); margin-bottom: 12px; }

/* 卡片三种非正常态：
   loading —— 隐藏内容，显示与预期内容等高的骨架（高度由 --skel 指定）
   na      —— 本次不适用（如 http:// 没有 TLS），保留位置、给出原因
   fail    —— 检测中断，没等到这部分结果 */
.card.loading > :not(h2), .card.na > :not(h2), .card.fail > :not(h2) { display: none; }
.card.loading > h2::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent); animation: spin .7s linear infinite;
}
.card.loading::after {
  content: ""; display: block; height: var(--skel, 160px); margin-top: 8px;
  border-radius: var(--radius-sm);
}
.card.na::after, .card.fail::after {
  content: attr(data-note); display: block; margin-top: 6px;
  font-size: .85rem; color: var(--text-3);
}
.card.na { box-shadow: none; background: transparent; border-style: dashed; }

/* 骨架闪光，瓦片与卡片共用 */
.card.loading::after, .tile.loading .v, .tile.loading .n {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* 新到的内容淡入，让人注意到「这里刚更新了」 */
.card.ready, .tile.ready { animation: fadein .35s ease-out; }
@keyframes fadein { from { opacity: .35; } to { opacity: 1; } }

.empty { color: var(--text-3); font-size: .88rem; padding: 18px 0; text-align: center; }

/* ---------------- 通用小件 ---------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px; border-radius: 20px;
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge:empty { display: none; }   /* 例如历史为空时的计数徽章 */
.badge.good     { color: var(--good);     border-color: color-mix(in srgb, var(--good) 50%, transparent);     background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge.warn     { color: var(--warn);     border-color: color-mix(in srgb, var(--warn) 50%, transparent);     background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.serious  { color: var(--serious);  border-color: color-mix(in srgb, var(--serious) 50%, transparent);  background: color-mix(in srgb, var(--serious) 12%, transparent); }
.badge.critical { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 50%, transparent); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.badge.info     { color: var(--c1);       border-color: color-mix(in srgb, var(--c1) 50%, transparent);       background: color-mix(in srgb, var(--c1) 12%, transparent); }

.kv { display: grid; grid-template-columns: minmax(100px, max-content) 1fr; gap: 4px 14px; font-size: .87rem; }
.kv dt { color: var(--text-3); }
.kv dd { font-family: var(--mono); color: var(--text-1); word-break: break-all; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-family: var(--mono); font-size: .78rem; padding: 2px 8px;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-2);
}

pre.code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: .8rem; line-height: 1.55; color: var(--text-2);
  overflow-x: auto; max-height: 380px; white-space: pre; tab-size: 2;
}

details.raw {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
details.raw > summary {
  padding: 10px 16px; cursor: pointer; font-size: .8rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--text-3);
  list-style: none; display: flex; align-items: center; gap: 10px;
}
details.raw > summary::-webkit-details-marker { display: none; }
details.raw > summary::before { content: "▸"; transition: transform .18s; color: var(--text-3); }
details.raw[open] > summary::before { transform: rotate(90deg); }
details.raw > div { padding: 0 16px 16px; }

/* ---------------- 证书链 ---------------- */

/* 容器查询：卡片够宽时证书横排，窄了就竖排——同一张卡在三列、两列、
   单列布局里宽度差很多，按视口断点判断会错。 */
.chain-wrap { container-type: inline-size; }
.chain { display: flex; align-items: stretch; overflow-x: auto; padding-bottom: 6px; }
.cert {
  position: relative;
  flex: 1 1 0; min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: flex; flex-direction: column; gap: 7px;
}
.cert.leaf { border-color: color-mix(in srgb, var(--c1) 55%, transparent); }
.cert.missing {
  border: 1px dashed var(--critical);
  background: color-mix(in srgb, var(--critical) 8%, var(--surface-2));
}
.cert.root { opacity: .92; }
.cert-link {
  flex: 0 0 30px; align-self: center;
  display: grid; place-items: center;
  color: var(--text-3);
}
.cert-link svg { display: block; width: 30px; }
.cert-link.broken { color: var(--critical); }
@container (max-width: 700px) {
  .chain { flex-direction: column; overflow-x: visible; }
  .cert { min-width: 0; }
  .cert-link { flex-basis: 24px; transform: rotate(90deg); }
}

.cert-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cert-role {
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700;
}
.cert-cn {
  font-family: var(--mono); font-size: .92rem; font-weight: 700;
  word-break: break-all; line-height: 1.35;
}
.cert-issuer { font-size: .8rem; color: var(--text-3); word-break: break-all; }
.cert-meta { display: flex; flex-wrap: wrap; gap: 4px; }

.life { margin-top: 2px; }
.life-bar {
  height: 5px; border-radius: 3px; background: var(--surface-3);
  overflow: hidden; position: relative;
}
.life-fill { height: 100%; border-radius: 3px 0 0 3px; }
.life-labels {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: .72rem; color: var(--text-3); margin-top: 4px;
}
.life-labels b { color: var(--text-2); font-weight: 400; }

.cert-more { font-size: .8rem; color: var(--text-3); }
.cert-more summary { cursor: pointer; color: var(--text-2); }
.cert-more dl { margin-top: 6px; }
.cert-more .kv { font-size: .78rem; grid-template-columns: minmax(64px, max-content) 1fr; }

/* 有效期时间轴 */
.timeline h3, .subhead {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700; margin-bottom: 8px;
}
.timeline-note { font-size: .75rem; color: var(--text-3); margin: -3px 0 7px; }

/* 时间轴用固定像素的行布局：SVG 横向自适应时会把字号和条高一起等比放大，
   容器越宽图越胖。这里横向仍是 %，纵向全部锁死。 */
.tl {
  display: grid;
  grid-template-columns: minmax(80px, 170px) 1fr minmax(90px, max-content);
  align-items: center;
  gap: 3px 10px;
  font-size: .72rem;
}
.tl-name {
  font-family: var(--mono); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.tl-track {
  position: relative; height: 14px;
  border-radius: 3px; background: var(--surface-2);
}
.tl-track > i {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border); pointer-events: none;
}
.tl-bar {
  position: absolute; top: 3px; height: 8px;
  border-radius: 4px; min-width: 3px;
  background: var(--c3);
}
.tl-bar.warn { background: var(--warn); }
.tl-bar.bad  { background: var(--critical); }
.tl-bar.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.tl-axis { height: 14px; background: none; }
.tl-axis > span {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: var(--mono); font-size: .66rem; color: var(--text-3);
  white-space: nowrap; line-height: 14px;
}
.tl-end {
  font-family: var(--mono); font-size: .68rem; color: var(--text-3);
  white-space: nowrap; text-align: right;
}
.tl-end b { font-weight: 700; color: var(--text-2); }
.tl-end.warn b { color: var(--warn); }
.tl-end.bad b  { color: var(--critical); }

.tl-now {
  grid-column: 2; position: relative; pointer-events: none;
  align-self: stretch;
}
.tl-now > i {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--c1); transform: translateX(-1px);
}
.tl-now > em {
  position: absolute; bottom: -13px; transform: translateX(-50%);
  font-style: normal; font-size: .66rem; font-weight: 700; color: var(--c1);
  white-space: nowrap;
}
.timeline { margin-top: 16px; padding-bottom: 14px; }

@media (max-width: 700px) {
  .tl { grid-template-columns: minmax(70px, 110px) 1fr; }
  .tl-end { display: none; }
  .tl-now { grid-column: 2; }
}

/* 诊断项 */
.issues { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.issue {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 10px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--text-3);
  font-size: .87rem;
}
.issue.critical { border-left-color: var(--critical); }
.issue.warn     { border-left-color: var(--warn); }
.issue.info     { border-left-color: var(--c1); }
.issue.ok       { border-left-color: var(--good); }
.issue .ico { font-size: .95rem; line-height: 1.4; }
.issue b { display: block; margin-bottom: 1px; }
.issue p { color: var(--text-2); }
.issue .fix {
  margin-top: 6px; font-family: var(--mono); font-size: .78rem;
  color: var(--text-2); background: var(--surface-3);
  padding: 6px 9px; border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.issue .fix::before { content: attr(data-label) "  "; color: var(--text-3); }

/* ---------------- DNS 传播矩阵 ---------------- */

.prop-groups { display: flex; flex-direction: column; gap: 10px; }
.pgroup {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 10px 12px;
  border-left: 3px solid var(--gcolor, var(--c1));
}
.pgroup-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.pgroup-head .cnt { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.pgroup-vals { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.pgroup-vals .val {
  font-family: var(--mono); font-size: .84rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gcolor, var(--c1)) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--gcolor, var(--c1)) 45%, transparent);
  color: var(--text-1);
}
.pgroup-vals .val.none { background: var(--surface-3); border-color: var(--border); color: var(--text-3); }

.resolvers { display: flex; flex-wrap: wrap; gap: 5px; }
.rchip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .78rem; padding: 3px 9px 3px 6px;
  border-radius: 20px; background: var(--surface-3);
  border: 1px solid var(--border); color: var(--text-2);
}
.rchip .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--gcolor, var(--c1)); flex: none; }
.rchip .ttl { font-family: var(--mono); color: var(--text-3); font-size: .72rem; }
.rchip .code {
  font-family: var(--mono); font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text-3); background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 3px; padding: 0 4px; line-height: 1.5;
}
.rchip.err { border-style: dashed; color: var(--text-3); }

.auth-panel { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.auth-panel:empty { display: none; }
.auth-wait { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text-3); }
.auth-note {
  font-size: .87rem; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 10px;
}
.auth-note.drift { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.auth-list { display: flex; flex-direction: column; gap: 5px; }
.auth-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .82rem;
  padding: 5px 10px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border);
}
.auth-row .ns { color: var(--text-1); }
.auth-row .ip { color: var(--text-3); }
.auth-row .ans { margin-left: auto; color: var(--c3); font-weight: 700; }
.auth-row .ans.err { color: var(--text-3); font-weight: 400; }

/* ---------------- 时序瀑布 ---------------- */

.wf { display: flex; flex-direction: column; gap: 11px; }
.wf-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .85rem; margin-bottom: 5px;
}
.wf-head .u { font-family: var(--mono); color: var(--text-2); word-break: break-all; flex: 1 1 180px; min-width: 0; }
.wf-head .ms { font-family: var(--mono); font-weight: 700; color: var(--text-1); }
.wf-bar { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.wf-seg { position: relative; min-width: 0; }
.wf-seg + .wf-seg { box-shadow: -2px 0 0 var(--surface-1); }
.wf-seg:first-child { border-radius: 4px 0 0 4px; }
.wf-seg:last-child  { border-radius: 0 4px 4px 0; }
.wf-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: .78rem; color: var(--text-2); }
.wf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wf-legend i { width: 9px; height: 9px; border-radius: 2px; display: block; }
.wf-legend b { font-family: var(--mono); color: var(--text-1); font-weight: 700; }

/* ---------------- 评分环 ---------------- */

.gauge-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.gauge { flex: none; position: relative; width: 108px; height: 108px; }
.gauge svg { transform: rotate(-90deg); display: block; width: 108px; height: 108px; }
.gauge .center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge .grade { font-family: var(--mono); font-size: 1.75rem; font-weight: 700; line-height: 1; }
.gauge .score { font-family: var(--mono); font-size: .76rem; color: var(--text-3); margin-top: 3px; }

.checks { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chk {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-size: .85rem;
}
.chk:hover { border-color: var(--border-strong); }
.chk .ico { font-size: .9rem; }
.chk .nm { font-family: var(--mono); font-size: .82rem; }
.chk .st { font-size: .76rem; color: var(--text-3); text-align: right; }
.chk-detail {
  margin: -2px 0 5px; padding: 8px 12px; font-size: .83rem; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.chk-detail ul { margin: 6px 0 0 18px; }
.chk-detail li { margin-bottom: 2px; }
.chk-detail .fix {
  margin-top: 8px; font-family: var(--mono); font-size: .78rem;
  background: var(--surface-3); padding: 7px 9px; border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; color: var(--text-2);
}

/* ---------------- 表格 ---------------- */

.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tbl th {
  text-align: left; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700; padding: 5px 8px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td {
  padding: 5px 8px; border-bottom: 1px solid var(--border);
  font-family: var(--mono); color: var(--text-2); vertical-align: top;
  word-break: break-all;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.k { color: var(--text-1); white-space: nowrap; }
.tbl td.ttl { white-space: nowrap; color: var(--text-3); }
.tbl-scroll { overflow-x: auto; }
/* 大站的 TXT 记录动辄几十条（各种域名验证），不封顶的话这张卡能有两千多像素高 */
#card-dns .tbl-scroll { max-height: 520px; overflow-y: auto; }
#card-dns .tbl th { position: sticky; top: 0; background: var(--surface-1); }

/* 协议版本矩阵 */
.vmatrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.vcell {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 8px 10px;
}
.vcell .vn { font-family: var(--mono); font-weight: 700; font-size: .9rem; }
.vcell .vs { font-size: .78rem; margin-top: 2px; }
.vcell.on  { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.vcell.on .vs { color: var(--good); }
.vcell.off .vs { color: var(--text-3); }
.vcell.legacy { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.vcell.legacy .vs { color: var(--warn); }
.vcell .vc { font-family: var(--mono); font-size: .72rem; color: var(--text-3); margin-top: 4px; word-break: break-all; }

/* 历史：两行紧凑行。第一行主机名（最需要看清的部分），第二行状态 + 相对时间；
   状态用左侧 3px 色条表达，不再占一个宽徽章。删除按钮悬停才出现。 */
.hist { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.hist-item {
  position: relative; display: block;
  padding: 6px 28px 6px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--st, var(--border-strong));
  cursor: pointer; transition: border-color .15s, background .15s;
}
.hist-item.s-good { --st: var(--good); }
.hist-item.s-warn { --st: var(--warn); }
.hist-item.s-critical { --st: var(--critical); }
.hist-item:hover { border-color: var(--border-strong); border-left-color: var(--st); background: var(--surface-3); }
.hist-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hist-item.current { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-left-color: var(--st); }
.hi-host { font-family: var(--mono); font-size: .88rem; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-hostname { font-weight: 700; }
.hi-path { color: var(--text-3); }
.hi-scheme {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 3px;
  padding: 0 3px; margin-right: 6px; vertical-align: 1px; font-weight: 400;
}
.hi-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--text-3); margin-top: 1px; }
.hi-st { color: var(--st); }
.hist-item .del, .rcard .del {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 20px; height: 20px; display: grid; place-items: center;
  color: var(--text-3); background: none; border: 0; border-radius: 4px; cursor: pointer;
  font-size: 1rem; line-height: 1; opacity: 0; transition: opacity .15s;
}
.hist-item:hover .del, .hist-item:focus-within .del, .rcard:hover .del, .rcard:focus-within .del { opacity: 1; }
.hist-item .del:hover, .rcard .del:hover { color: var(--critical); background: var(--surface-1); }
@media (hover: none) { .hist-item .del, .rcard .del { opacity: 1; } }
/* 窄屏时历史在结果下方，空间宽，铺成多列 */
.lower .hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-height: 260px; }

/* Cookie */
.cookie {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 9px 12px; margin-bottom: 7px;
}
.cookie-name { font-family: var(--mono); font-weight: 700; font-size: .9rem; margin-bottom: 5px; }
.cookie ul { margin: 7px 0 0 18px; font-size: .82rem; color: var(--warn); }

footer {
  border-top: 1px solid var(--border); padding: 16px 0 28px;
  color: var(--text-3); font-size: .82rem;
}
footer .wrap { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
footer .spacer { flex: 1; }

.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;
}

@media (forced-colors: active) {
  .cert, .card, .tile, .pgroup, .task { border: 1px solid CanvasText; }
}

/* ---------------- 分段控件（主题 / 语言） ---------------- */

.seg {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg button {
  border: 0; background: transparent; cursor: pointer;
  color: var(--text-3); font-family: var(--sans); font-size: .8rem;
  padding: 3px 8px; border-radius: 4px; line-height: 1.3;
  transition: background .15s, color .15s;
  min-width: 28px;
}
.seg button:hover { color: var(--text-1); }
.seg button[aria-pressed="true"] {
  background: var(--surface-3); color: var(--text-1); font-weight: 600;
}
.seg.lang button { font-family: var(--mono); }
/* 主题图标用内联 SVG：☾ 这类符号交给系统字体回退时，Windows 上会落到
   微软雅黑，字形看起来像字母 C */
.seg.theme button { display: inline-grid; place-items: center; padding: 3px 7px; }
.seg.theme svg { width: 14px; height: 14px; display: block; }

@media (max-width: 900px) {
  .topbar .meta { display: none; }
  .brand small { display: none; }
}
@media (max-width: 560px) {
  .mini-progress #mini-text { display: none; }
}

/* ---------------- 留言：悬浮按钮 + 对话框 ---------------- */

.fab {
  position: fixed; z-index: 50;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 16px 0 14px; border-radius: 20px;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: .92rem; font-weight: 600;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow);
  transition: transform .15s, filter .15s;
}
.fab:hover { filter: brightness(1.1); transform: translateY(-1px); }
.fab:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }
/* 手机上只留图标，不挡内容 */
@media (max-width: 560px) {
  .fab { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .fab span { display: none; }
}

.dlg {
  margin: auto; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface-1); color: var(--text-1);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px 18px; box-shadow: var(--shadow);
}
.dlg[open] { animation: pop .18s ease-out; }
.dlg::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.dlg-head h2 { font-size: 1.1rem; }
.dlg .sub { font-size: .85rem; color: var(--text-3); }

.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-row { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-form .field.grow { flex: 1 1 220px; min-width: 0; }

textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--sans);
  font-size: .95rem;
  line-height: 1.55;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  min-height: 120px;
  transition: border-color .15s, box-shadow .15s;
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.contact-count { align-self: flex-end; font-family: var(--mono); font-size: .75rem; color: var(--text-3); }
.contact-count.over { color: var(--critical); }
.contact-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contact-note { font-size: .8rem; color: var(--text-3); flex: 1 1 200px; }

.contact-result {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: .88rem;
  border: 1px solid var(--border); background: var(--surface-2);
}
.contact-result.ok  { border-color: color-mix(in srgb, var(--good) 50%, transparent);     background: color-mix(in srgb, var(--good) 12%, transparent); }
.contact-result.err { border-color: color-mix(in srgb, var(--critical) 50%, transparent); background: color-mix(in srgb, var(--critical) 12%, transparent); }

/* 蜜罐必须对真人不可见，但不能用 display:none —— 有些机器人会跳过被隐藏的字段 */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 减少动态效果：保留状态变化，去掉持续运动 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------------- 诊断结论 ---------------- */
.findings { margin-bottom: 14px; }
.fd-head { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.fd-head h2 {
  font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); display: flex; align-items: center; gap: 8px;
}
.fd-head h2 .badge { text-transform: none; letter-spacing: 0; }
.fd-counts { font-size: .8rem; color: var(--text-3); }
.fd-head .btn { margin-left: auto; }
.btn.ghost {
  height: 30px; padding: 0 12px; font-size: .85rem; font-weight: 500;
  background: transparent; color: var(--text-1); border: 1px solid var(--border-strong);
}
.btn.ghost:hover:not(:disabled) { filter: none; border-color: var(--accent); color: var(--accent); }
.fd-edge {
  font-size: .82rem; color: var(--text-2); margin-bottom: 10px; padding: 7px 11px;
  border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.fd-list { list-style: none; display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
@container main (min-width: 1060px) { .fd-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container main (min-width: 1700px) { .fd-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fd-list .issue { margin: 0; }

/* DNS 记录：不挂在主机名上的记录注明查自哪里 */
.tbl td.k .src { font-family: var(--mono); font-size: .68rem; color: var(--text-3); font-weight: 400; white-space: nowrap; }

/* 报告容器只在打印时出现 */
.report { display: none; }

/* ================= PDF 报告（打印版面） =================
   与仪表盘完全独立：固定浅色、小字号、表格化。窄页边距 + 两栏拼排，压缩页数。
   @page 的页码盒子 Chrome 131+ 支持，其它浏览器忽略，不影响版面。 */
@page {
  size: A4;
  margin: 9mm 9mm 11mm;
  @bottom-right { content: counter(page) " / " counter(pages); font: 7pt "JetBrains Mono", monospace; color: #8a919c; }
}
@media print {
  html, body { background: #fff !important; color: #111 !important; min-height: 0; }
  body::before { display: none !important; }
  body > *:not(#report) { display: none !important; }
  .report {
    display: block !important;
    font-family: var(--sans); font-size: 8.4pt; line-height: 1.42; color: #111;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .report .mono { font-family: var(--mono); font-size: .92em; }
  .report b { font-weight: 650; }

  .r-head { display: flex; gap: 10mm; align-items: flex-start; padding-bottom: 3mm; border-bottom: 1.2pt solid #111; margin-bottom: 3mm; }
  .r-title { flex: 1; min-width: 0; }
  .r-brand { font-size: 7.5pt; letter-spacing: .08em; text-transform: uppercase; color: #5b6370; font-weight: 700; }
  .r-target { font-family: var(--mono); font-size: 13pt; font-weight: 700; margin: .5mm 0 1mm; word-break: break-all; }
  .r-meta { display: flex; flex-wrap: wrap; gap: .5mm 4mm; font-size: 7.4pt; color: #4d5561; }
  .r-meta b { color: #111; font-weight: 500; }
  .r-verdict { flex: none; text-align: right; padding: 1.5mm 3mm; border-radius: 1.5mm; border: 1pt solid currentColor; min-width: 34mm; }
  .r-vlabel { font-size: 6.8pt; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
  .r-vvalue { font-size: 13pt; font-weight: 750; line-height: 1.2; }
  .r-vcounts { font-size: 6.8pt; color: #4d5561; }
  .r-verdict.good { color: #1a7f37; } .r-verdict.warn { color: #9a6700; } .r-verdict.bad { color: #c62828; }

  .r-sec { margin-bottom: 3.2mm; break-inside: auto; }
  .r-sec > h2 {
    font-size: 8pt; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: #2a78d6;
    border-bottom: .6pt solid #c9d4e3; padding-bottom: .6mm; margin-bottom: 1.6mm; break-after: avoid;
  }
  .r-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .r-two > .r-sec { min-width: 0; }

  .r-cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(22mm, 1fr)); gap: 1.5mm; }
  .r-cell { border: .6pt solid #dfe3e9; border-top: 1.6pt solid #bfc7d2; border-radius: 1mm; padding: 1.2mm 2mm; break-inside: avoid; }
  .r-cell .k { font-size: 6.6pt; text-transform: uppercase; letter-spacing: .05em; color: #6b7380; }
  .r-cell .v { font-family: var(--mono); font-size: 10.5pt; font-weight: 700; line-height: 1.25; }
  .r-cell .n { font-size: 6.6pt; color: #6b7380; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .r-cell.good { border-top-color: #1a7f37; } .r-cell.good .v { color: #1a7f37; }
  .r-cell.warn { border-top-color: #bf8700; } .r-cell.warn .v { color: #9a6700; }
  .r-cell.bad { border-top-color: #c62828; } .r-cell.bad .v { color: #c62828; }

  .r-find { list-style: none; display: grid; gap: 1.2mm; }
  .r-find li { display: grid; grid-template-columns: 11mm 1fr; gap: 2mm; break-inside: avoid; }
  .r-detail { display: block; color: #3d4450; }
  .r-fix { margin-top: .4mm; font-family: var(--mono); font-size: 7.2pt; color: #24292f; background: #f3f5f8; border-radius: .8mm; padding: .5mm 1.5mm; word-break: break-word; }
  .r-fix i { font-style: normal; font-family: var(--sans); color: #6b7380; margin-right: 1.5mm; }
  .r-tag {
    display: inline-block; font-size: 6.5pt; font-weight: 700; line-height: 1.35; text-align: center;
    padding: 0 1.2mm; border-radius: .8mm; border: .6pt solid currentColor; white-space: nowrap; color: #5b6370;
  }
  .r-find .r-tag { display: block; margin-top: .3mm; align-self: start; }
  .r-edge { font-size: 7.4pt; color: #3d4450; background: #eef4fc; border-left: 1.6pt solid #2a78d6; padding: .8mm 2mm; margin-bottom: 1.6mm; }
  .r-tag.bad { color: #c62828; background: #fdecec; } .r-tag.warn { color: #9a6700; background: #fff5d6; }
  .r-tag.info { color: #2a78d6; background: #eaf2fc; } .r-tag.good { color: #1a7f37; background: #e8f5ec; }

  .r-tbl { width: 100%; border-collapse: collapse; font-size: 7.4pt; margin-bottom: 1.6mm; table-layout: auto; }
  .r-tbl th { text-align: left; font-weight: 650; color: #5b6370; font-size: 6.8pt; border-bottom: .8pt solid #bfc7d2; padding: .5mm 1.5mm .5mm 0; }
  .r-tbl td { border-bottom: .4pt solid #e6e9ee; padding: .55mm 1.5mm .55mm 0; vertical-align: top; word-break: break-word; }
  .r-tbl tr { break-inside: avoid; }
  .r-tbl .num { text-align: right; white-space: nowrap; }
  .r-tbl .nw { white-space: nowrap; }
  .r-tbl .w-hdr { width: 30%; } .r-tbl .w-val { width: 42%; } .r-tbl .w-type { width: 24mm; }
  .r-tbl .r-tag { margin-right: 1mm; }

  .r-kv { display: grid; grid-template-columns: max-content 1fr; gap: .4mm 3mm; font-size: 7.6pt; margin-bottom: 1.6mm; }
  .r-kv dt { color: #6b7380; } .r-kv dd { min-width: 0; word-break: break-word; }
  .r-dim { color: #8a919c; font-size: .92em; }
  .r-note { font-size: 7.6pt; } .r-empty { color: #1a7f37; }
  .r-foot { margin-top: 3mm; padding-top: 1.5mm; border-top: .6pt solid #dfe3e9; font-size: 6.6pt; color: #8a919c; }
}
