/* ============================================================
   NetProbe 2.0 — 深色仪表盘
   调色板取自已验证的数据可视化色板；分类色按固定顺序使用，不循环。
   ============================================================ */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../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);
  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 2240px;

  /* 等宽栈必须自带中文托底。
     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;
    --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;
  --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; }

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}
/* 4K 27" 常见的 150%/200% 缩放下依然保持信息密度；不用 vw 单位，
   否则窗口一变窄字号就跟着塌，正是老版本的毛病。 */
@media (min-width: 2200px) { html { font-size: 16px; } }
@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.55;
  -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 24px; }

/* ---------------- 顶栏 ---------------- */

.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: 16px;
  height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--text-3); letter-spacing: .04em; }
.topbar .spacer { flex: 1; }
.topbar .meta { font-family: var(--mono); font-size: .78rem; color: var(--text-3); }
.topbar .meta b { color: var(--text-2); font-weight: 400; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text-1); }

/* ---------------- 控制台 ---------------- */

.console { padding: 26px 0 8px; }
.console-inner {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.console-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1 1 420px; min-width: 260px; }
.field label { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

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: 9px 12px;
  height: 40px;
  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);
}
select { cursor: pointer; }

.btn {
  height: 40px; padding: 0 22px;
  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: .5; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--border-strong); color: var(--text-1); }

.toggles { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--text-2); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* 进度轨 */
.progress { margin-top: 14px; display: none; }
.progress.on { display: block; }
.progress-rail { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.progress-text {
  margin-top: 8px; font-family: var(--mono); font-size: .78rem; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.dot-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.banner {
  margin-top: 14px; padding: 12px 14px; 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; }

/* ---------------- 栅格 ---------------- */

main { padding: 20px 0 60px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; align-items: start; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 1500px) {
  .span-5, .span-7 { grid-column: span 6; }
  .span-3 { grid-column: span 4; }
}
@media (max-width: 1100px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card > h2 {
  font-size: .82rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 4px;
  display: flex; align-items: center; gap: 10px;
}
.card > h2 .badge { text-transform: none; letter-spacing: 0; }
.card > .sub { font-size: .84rem; color: var(--text-3); margin-bottom: 16px; }
.card.hidden { display: none; }

.empty { color: var(--text-3); font-size: .88rem; padding: 24px 0; text-align: center; }

/* ---------------- 概览瓦片 ---------------- */

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; grid-column: span 12; }
@media (max-width: 1500px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .tiles { grid-template-columns: repeat(2, 1fr); } }

.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.tile .k { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.tile .v {
  font-family: var(--mono); font-size: 1.85rem; font-weight: 700; line-height: 1.15;
  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); }

/* ---------------- 通用小件 ---------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; 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.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(120px, max-content) 1fr; gap: 6px 16px; font-size: .88rem; }
.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: 6px; }
.chip {
  font-family: var(--mono); font-size: .76rem; padding: 3px 9px;
  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: 12px 14px;
  font-size: .8rem; line-height: 1.6; color: var(--text-2);
  overflow-x: auto; max-height: 420px; white-space: pre; tab-size: 2;
}

details.raw {
  grid-column: span 12;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
details.raw > summary {
  padding: 12px 20px; cursor: pointer; font-size: .82rem; 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 20px 20px; }

/* ---------------- 证书链 ---------------- */

.chain-scroll { overflow-x: auto; padding-bottom: 8px; }
.chain {
  display: flex; align-items: stretch; gap: 0;
  min-width: min-content;
}
.cert {
  position: relative;
  flex: 0 0 320px; max-width: 320px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 15px;
  display: flex; flex-direction: column; gap: 9px;
}
.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 46px; align-self: center;
  display: grid; place-items: center;
  color: var(--text-3);
}
.cert-link svg { display: block; }
.cert-link.broken { color: var(--critical); }

.cert-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cert-role {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700;
}
.cert-cn {
  font-family: var(--mono); font-size: .95rem; font-weight: 700;
  word-break: break-all; line-height: 1.35;
}
.cert-issuer { font-size: .78rem; color: var(--text-3); word-break: break-all; }
.cert-meta { display: flex; flex-wrap: wrap; gap: 5px; }

.life { margin-top: 2px; }
.life-bar {
  height: 6px; 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: .7rem; color: var(--text-3); margin-top: 5px;
}
.life-labels b { color: var(--text-2); font-weight: 400; }

.cert-more { font-size: .78rem; color: var(--text-3); }
.cert-more summary { cursor: pointer; color: var(--text-2); }
.cert-more dl { margin-top: 8px; }
.cert-more .kv { font-size: .76rem; grid-template-columns: minmax(74px, max-content) 1fr; }

/* 有效期时间轴 */
.timeline h3, .subhead {
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700; margin-bottom: 10px;
}
.timeline-note { font-size: .74rem; color: var(--text-3); margin: -4px 0 8px; }

/* 时间轴用固定像素的行布局：SVG 横向自适应时会把字号和条高一起等比放大，
   容器越宽图越胖。这里横向仍是 %，纵向全部锁死。 */
.tl {
  display: grid;
  grid-template-columns: minmax(90px, 190px) 1fr minmax(96px, max-content);
  align-items: center;
  gap: 3px 10px;
  font-size: .7rem;
}
.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;   /* 条高固定 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: .64rem; color: var(--text-3);
  white-space: nowrap; line-height: 14px;
}
.tl-end {
  font-family: var(--mono); font-size: .66rem; 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: .64rem; font-weight: 700; color: var(--c1);
  white-space: nowrap;
}
.timeline { margin-top: 20px; 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: 8px; margin-top: 20px; }
.issue {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 12px;
  padding: 11px 14px; 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: 1rem; line-height: 1.4; }
.issue b { display: block; margin-bottom: 2px; }
.issue p { color: var(--text-2); }
.issue .fix {
  margin-top: 7px; font-family: var(--mono); font-size: .78rem;
  color: var(--text-2); background: var(--surface-3);
  padding: 7px 10px; border-radius: var(--radius-sm);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
/* 标签文字由 JS 用 data-label 注入，才能跟随语言切换 */
.issue .fix::before { content: attr(data-label) "  "; color: var(--text-3); }

/* ---------------- DNS 传播矩阵 ---------------- */

.prop-groups { display: flex; flex-direction: column; gap: 12px; }
.pgroup {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 13px 15px;
  border-left: 3px solid var(--gcolor, var(--c1));
}
.pgroup-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.pgroup-head .cnt { font-family: var(--mono); font-size: .8rem; color: var(--text-3); }
.pgroup-vals { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pgroup-vals .val {
  font-family: var(--mono); font-size: .84rem; font-weight: 700;
  padding: 3px 10px; 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: 6px; }
.rchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; padding: 4px 10px 4px 7px;
  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: .64rem; 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: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.auth-note {
  font-size: .87rem; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px;
}
.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: 6px; }
.auth-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: .82rem;
  padding: 7px 12px; 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: 14px; }
.wf-hop { }
.wf-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: .84rem; margin-bottom: 7px;
}
.wf-head .u { font-family: var(--mono); color: var(--text-2); word-break: break-all; flex: 1 1 200px; min-width: 0; }
.wf-head .ms { font-family: var(--mono); font-weight: 700; color: var(--text-1); }
.wf-bar { display: flex; height: 24px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.wf-seg { position: relative; min-width: 0; }
/* 段与段之间留 2px 表面色缝隙，色盲用户靠缝隙也能分段 */
.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: 14px; margin-top: 12px; font-size: .78rem; color: var(--text-2); }
.wf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wf-legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }
.wf-legend b { font-family: var(--mono); color: var(--text-1); font-weight: 700; }

/* ---------------- 评分环 ---------------- */

.gauge-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.gauge { flex: none; position: relative; width: 132px; height: 132px; }
.gauge svg { transform: rotate(-90deg); display: block; }
.gauge .center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge .grade { font-family: var(--mono); font-size: 2rem; font-weight: 700; line-height: 1; }
.gauge .score { font-family: var(--mono); font-size: .78rem; color: var(--text-3); margin-top: 3px; }

.checks { flex: 1 1 320px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.chk {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-size: .86rem;
}
.chk:hover { border-color: var(--border-strong); }
.chk .ico { font-size: .95rem; }
.chk .nm { font-family: var(--mono); font-size: .84rem; }
.chk .st { font-size: .76rem; color: var(--text-3); text-align: right; }
.chk-detail {
  margin: -2px 0 6px; padding: 10px 14px; 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: 7px 0 0 18px; }
.chk-detail li { margin-bottom: 3px; }
.chk-detail .fix {
  margin-top: 9px; font-family: var(--mono); font-size: .78rem;
  background: var(--surface-3); padding: 8px 10px; 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: 7px 10px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td {
  padding: 7px 10px; 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; }
/* TTL 列很窄，"57 s" 会被折成两行 */
.tbl td.ttl { white-space: nowrap; color: var(--text-3); }
.tbl-scroll { overflow-x: auto; }

/* 协议版本矩阵 */
.vmatrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.vcell {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 11px 13px;
}
.vcell .vn { font-family: var(--mono); font-weight: 700; font-size: .92rem; }
.vcell .vs { font-size: .76rem; margin-top: 3px; }
.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: .7rem; color: var(--text-3); margin-top: 5px; word-break: break-all; }

/* 历史 */
.hist { display: flex; flex-direction: column; gap: 5px; max-height: 320px; overflow-y: auto; }
.hist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-size: .84rem;
}
.hist-item:hover { border-color: var(--border-strong); }
.hist-item .u { font-family: var(--mono); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .t { font-size: .74rem; color: var(--text-3); white-space: nowrap; }
.hist-item .del { color: var(--text-3); background: none; border: 0; cursor: pointer; padding: 0 4px; font-size: 1rem; line-height: 1; }
.hist-item .del:hover { color: var(--critical); }

/* Cookie */
.cookie {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 11px 14px; margin-bottom: 8px;
}
.cookie-name { font-family: var(--mono); font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.cookie ul { margin: 8px 0 0 18px; font-size: .82rem; color: var(--warn); }

footer {
  border-top: 1px solid var(--border); padding: 20px 0 34px;
  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 { 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: .78rem;
  padding: 4px 9px; border-radius: 4px; line-height: 1.3;
  transition: background .15s, color .15s;
  min-width: 30px;
}
.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); }

@media (max-width: 900px) {
  .topbar .meta { display: none; }
  .brand small { display: none; }
}

/* ---------------- 留言表单 ---------------- */

.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.contact-row { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-form .field.grow { flex: 1 1 260px; }

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.6;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 110px;
  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: .74rem; color: var(--text-3);
}
.contact-count.over { color: var(--critical); }

.contact-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.contact-note { font-size: .8rem; color: var(--text-3); }

.contact-result {
  padding: 11px 14px; 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;
}

#card-contact.focused { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
