/* ============================================================
   状态码 · 站点检测台
   深色仪表盘风格：冷灰底 + 青色强调 + 五档状态色
   零外部依赖（字体 / 图标 / 图片全部本地或内联）
   ============================================================ */

:root {
  --bg: #080c11;
  --panel: #101821;
  --panel-2: #16202b;
  --panel-3: #1b2632;

  --line: rgba(151, 170, 190, 0.14);
  --line-2: rgba(151, 170, 190, 0.26);

  --ink: #e8eef6;
  --ink-2: #aab8c7;   /* 对 --bg 9.1:1 / 对 --panel 7.6:1 */
  --ink-3: #8a9aab;   /* 对 --bg 6.1:1 / 对 --panel 5.1:1 */

  --accent: #2dd4bf;
  --accent-ink: #04211d;
  --accent-dim: rgba(45, 212, 191, 0.12);

  --wrap: 1160px;
  --gut: 20px;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* 装饰光晕：独立层，不参与任何文字的祖先链（保证对比度可测） */
.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 340px at 18% -6%, rgba(45, 212, 191, 0.10), transparent 70%),
    radial-gradient(620px 320px at 88% 2%, rgba(56, 189, 248, 0.07), transparent 70%);
}
.glow::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.55), rgba(56, 189, 248, 0.28), transparent);
}

.hdr, main, .ftr { position: relative; z-index: 1; }

.wrap {
  width: min(var(--wrap), 100% - (var(--gut) * 2));
  margin-inline: auto;
}

.skip {
  position: absolute;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 99;
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

/* ------------------------------------------------------------ 页头 */

.hdr {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.hdr__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand__mark { color: var(--accent); flex: 0 0 auto; }
.brand__txt {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand__sub {
  margin-left: 10px;
  padding-left: 11px;
  border-left: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.hdr__svc {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: 0 0 0 3px rgba(138, 154, 171, 0.15);
  flex: 0 0 auto;
}
.dot.is-ok { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
.dot.is-bad { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }

/* ------------------------------------------------------------ 主区 */

main { flex: 1 0 auto; padding-block: 34px 48px; }

.intro { margin-bottom: 22px; }
.intro h1 {
  margin: 0 0 10px;
  font-size: 27px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.intro p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 14.5px;
}

/* ------------------------------------------------------------ 输入面板 */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}
.panel__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.panel__hint { font-size: 12.5px; color: var(--ink-3); }

.input {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #0b1219;
  color: var(--ink);
  font: 13.5px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #7a8a9b; }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 14px;
}
.opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.opt input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: #0b1219;
  display: grid;
  place-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.opt input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 9px;
  transform: scale(0);
  transition: transform 0.12s ease;
  background: var(--accent);
  clip-path: polygon(14% 46%, 0 61%, 39% 100%, 100% 22%, 85% 8%, 38% 70%);
}
.opt input[type="checkbox"]:checked { border-color: var(--accent); }
.opt input[type="checkbox"]:checked::before { transform: scale(1); }
.opt input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.opt--num { cursor: default; gap: 6px; }
.opt--num input,
.opt--num select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #0b1219;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.opt--num input[type="number"] { width: 56px; text-align: center; }
.opt--num select { width: 62px; cursor: pointer; }
.opt--num input:focus,
.opt--num select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ------------------------------------------------------------ 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn .i { flex: 0 0 auto; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: #5ee7d5; }
.btn--primary[disabled] {
  background: var(--panel-3);
  color: var(--ink-3);
  cursor: not-allowed;
  transform: none;
}
.btn--ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-2);
  font-weight: 500;
}
.btn--ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn--mini {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-color: var(--line-2);
  background: transparent;
  color: var(--ink-2);
}
.btn--mini:hover { border-color: var(--ink-3); color: var(--ink); }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.actions__hint {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-left: auto;
}

.notice {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 13px;
  border: 1px solid;
}
.notice--warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.09);
  color: #fdd45e;
}
.notice--err {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.1);
  color: #ffb4b4;
}

/* ------------------------------------------------------------ 结果区 */

.results { margin-top: 26px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--ink-3);
}
.stat b {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat--ok b { color: #5ee9b5; }
.stat--move b { color: #7cd4fd; }
.stat--warn b { color: #fdd45e; }
.stat--bad b { color: #ff9f9f; }
.stat--err b { color: #c7d0da; }

.rbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip.is-on {
  background: var(--accent-dim);
  border-color: rgba(45, 212, 191, 0.45);
  color: var(--accent);
  font-weight: 600;
}
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rtools { display: flex; gap: 8px; }

.list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.thead {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 96px minmax(0, 1.55fr) 76px 30px;
  column-gap: 16px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  background: #0c141c;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.thead__r { text-align: right; }

.row + .row { border-top: 1px solid var(--line); }
.row__head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 96px minmax(0, 1.55fr) 76px 30px;
  grid-template-areas: "site status title ms more";
  align-items: center;
  column-gap: 16px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.row__head:hover { background: rgba(255, 255, 255, 0.028); }
.row__head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.row__site {
  grid-area: site;
  min-width: 0;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__status { grid-area: status; }
.row__title {
  grid-area: title;
  min-width: 0;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row__title.is-empty { color: var(--ink-3); font-style: normal; }
.row__ms {
  grid-area: ms;
  text-align: right;
  font: 12.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.row__more {
  grid-area: more;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--ink-3);
  transition: transform 0.2s ease, color 0.15s ease;
}
.row__head:hover .row__more { color: var(--ink-2); }
.row.is-open .row__more { transform: rotate(180deg); color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 25px;
  padding: 0 9px;
  border-radius: 7px;
  font: 700 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.badge--ok   { background: #06281f; color: #5ee9b5; }
.badge--move { background: #07243a; color: #7cd4fd; }
.badge--warn { background: #322004; color: #fdd45e; }
.badge--bad  { background: #3a1417; color: #ff9f9f; }
.badge--err  { background: #23262b; color: #c7d0da; font-size: 12px; font-weight: 600; }

/* 展开详情 */
.detail {
  padding: 4px 16px 18px;
  border-top: 1px dashed var(--line);
  margin-top: -1px;
}
.detail[hidden] { display: none; }

.dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 22px;
  padding-block: 14px;
}
.dcell { min-width: 0; }
.dk {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.dv {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.dv--mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.dv a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(45, 212, 191, 0.35); }
.dv a:hover { border-bottom-color: var(--accent); }

.chain {
  list-style: none;
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1219;
}
.chain__t {
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.chain li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.chain li + li { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 3px; }
.chain__s {
  flex: 0 0 auto;
  min-width: 42px;
  font: 700 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink);
}
.chain__s--move { color: #7cd4fd; }
.chain__s--ok { color: #5ee9b5; }
.chain__s--bad { color: #ff9f9f; }
.chain__u { overflow-wrap: anywhere; }
.chain__ms { margin-left: auto; flex: 0 0 auto; color: var(--ink-3); font-family: ui-monospace, monospace; font-size: 11.5px; }

.errmsg {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.08);
  color: #ffb4b4;
  font-size: 13px;
}
.errmsg b { font-family: ui-monospace, monospace; font-size: 12px; opacity: 0.85; margin-right: 8px; }

/* ------------------------------------------------------------ 页脚 */

.ftr {
  border-top: 1px solid var(--line);
  padding-block: 20px 26px;
  background: #060a0e;
}
.ftr__in {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.ftr p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 68ch;
}
.ftr__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 900px) {
  .list .thead { display: none; }
  .row__head {
    grid-template-columns: 96px minmax(0, 1fr) 30px;
    grid-template-areas:
      "status ms more"
      "site site site"
      "title title title";
    row-gap: 7px;
    padding-block: 14px;
  }
  .row__ms { text-align: right; }
  .dgrid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 640px) {
  :root { --gut: 15px; }
  main { padding-block: 24px 36px; }
  .intro h1 { font-size: 21px; }
  .intro p { font-size: 13.5px; }
  .panel { padding: 16px 14px; }
  .panel__head { gap: 3px; margin-bottom: 10px; }
  .panel__hint { flex: 1 1 100%; font-size: 12px; }
  .hdr__in { min-height: 58px; }
  .brand__sub { display: none; }
  .hdr__svc { font-size: 11.5px; }
  .actions .btn { flex: 1 1 auto; }
  .actions__hint { width: 100%; margin-left: 0; text-align: left; }
  .row__head { padding-inline: 13px; }
  .detail { padding-inline: 13px; }
  .stats { gap: 6px; }
  .stat { padding: 7px 10px; font-size: 12px; }
  .stat b { font-size: 14px; }
  .ftr__mono { white-space: normal; }
}

@media (max-width: 400px) {
  .brand__txt { font-size: 15.5px; }
  .row__head { grid-template-columns: 84px minmax(0, 1fr) 26px; column-gap: 10px; }
  .badge { min-width: 52px; font-size: 12px; }
  .rtools { width: 100%; }
  .rtools .btn { flex: 1 1 0; }
}

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

/* 滚动条（Webkit） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a1017; }
::-webkit-scrollbar-thumb { background: #23303d; border-radius: 5px; border: 2px solid #0a1017; }
::-webkit-scrollbar-thumb:hover { background: #31414f; }
