/* ping123 — 公共样式 */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #16202b;
  --muted: #5e6b78;
  --faint: #8a96a3;
  --line: #dde3e9;
  --brand: #0e7c7b;
  --brand-ink: #0a5d5c;
  --brand-soft: #e1f2f1;
  --ok: #15803d; --ok-soft: #e3f5ea;
  --warn: #a16207; --warn-soft: #fbf1d9;
  --bad: #c02626; --bad-soft: #fde8e8;
  --crit: #7f1d1d;
  --na-soft: #edf0f3;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720; --surface: #16202b; --surface-2: #1b2734; --ink: #e6ecf1; --muted: #9aa7b4; --faint: #6f7d8b;
    --line: #26323f; --brand: #3bb3b1; --brand-ink: #6fd0ce; --brand-soft: #123332;
    --ok: #4ade80; --ok-soft: #12291c; --warn: #fbbf24; --warn-soft: #2d2410; --bad: #f87171; --bad-soft: #321616;
    --crit: #fca5a5; --na-soft: #1f2a36; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 0 16px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; flex: none; }
.logo:hover { text-decoration: none; }
.logo svg { display: block; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--brand-ink); background: var(--brand-soft); font-weight: 600; }

/* ---------- 布局 ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 26px; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--muted); max-width: 72ch; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }
.mt2 { margin-top: 28px; }

/* ---------- 面板 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel > header h2 { font-size: 15px; margin: 0; }
.panel > header .aside { color: var(--muted); font-size: 13px; text-align: right; }
.panel .body { padding: 16px 18px; }
.panel .body.flush { padding: 0; }
.section-title { font-size: 18px; margin: 32px 0 12px; }

/* ---------- 键值表 ---------- */
dl.kv { margin: 0; padding: 4px 18px; }
.kv > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
@media (max-width: 480px) { .kv > div { grid-template-columns: 1fr; gap: 0; } }

/* ---------- 检测项列表 ---------- */
.checks { padding: 2px 18px; }
.check { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.check:last-child { border-bottom: 0; }
.check .d { grid-column: 1 / -1; color: var(--muted); font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; font-size: 12px; line-height: 20px; padding: 0 9px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.t-ok { color: var(--ok); background: var(--ok-soft); }
.t-warn { color: var(--warn); background: var(--warn-soft); }
.t-bad { color: var(--bad); background: var(--bad-soft); }
.t-crit { color: #fff; background: var(--bad); }
.t-na { color: var(--muted); background: var(--na-soft); }
.t-brand { color: var(--brand-ink); background: var(--brand-soft); }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); } .c-crit { color: var(--bad); } .c-na { color: var(--muted); }

/* ---------- 表单 ---------- */
.field { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-width: 0;
}
input[type=text], input[type=search] { flex: 1 1 220px; }
textarea { width: 100%; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th, .t td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { color: var(--muted); font-weight: 500; font-size: 13px; background: var(--surface-2); }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 首屏 IP ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hero-main { padding: 26px 28px; min-width: 0; }
.hero .label { color: var(--muted); font-size: 13px; }
.hero .ip { font: 600 clamp(28px, 5.4vw, 46px)/1.1 var(--mono); letter-spacing: -0.02em; margin: 6px 0 4px; word-break: break-all; }
.hero .ip.long { font-size: clamp(20px, 3.2vw, 30px); }
.hero .intform { font: 12px var(--mono); color: var(--faint); }
.hero .loc { font-size: 17px; margin-top: 14px; }
.hero .org { color: var(--muted); margin-top: 2px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.hero .actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero-map { position: relative; min-height: 300px; background: var(--surface-2); border-left: 1px solid var(--line); }
.hero-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-switch { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.map-switch button { font: inherit; font-size: 12px; border: 0; background: none; color: var(--muted); padding: 4px 10px; cursor: pointer; }
.map-switch button.on { background: var(--brand); color: #fff; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } .hero-map { border-left: 0; border-top: 1px solid var(--line); min-height: 220px; } }

/* 信号格风险条 */
.meter { margin-top: 22px; }
.meter-top { display: flex; align-items: baseline; gap: 10px; }
.meter-score { font: 700 34px/1 var(--mono); font-variant-numeric: tabular-nums; }
.meter-level { font-weight: 600; }
.meter-sub { color: var(--muted); font-size: 13px; margin-left: auto; }
.cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin-top: 10px; height: 14px; }
.cells i { display: block; border-radius: 2px; background: var(--na-soft); transition: background .25s; }
.cells i.on.l0 { background: var(--ok); } .cells i.on.l1 { background: var(--warn); } .cells i.on.l2 { background: var(--bad); } .cells i.on.l3 { background: var(--crit); }
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }

/* 搜索 */
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; font-size: 15px; padding: 11px 14px; }

/* AI 应用评分 */
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.app { padding: 16px 18px; border-right: 1px solid var(--line); color: var(--ink); display: block; }
.app:last-child { border-right: 0; }
.app:hover { background: var(--surface-2); text-decoration: none; }
.app .n { font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.app .s { font: 700 28px/1.2 var(--mono); margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.app .bar { height: 4px; border-radius: 2px; background: var(--na-soft); overflow: hidden; margin: 8px 0 6px; }
.app .bar span { display: block; height: 100%; }
.app .note { font-size: 12px; color: var(--muted); }
@media (max-width: 820px) { .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app:nth-child(2) { border-right: 0; } .app:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* 连通性 / 时钟 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.tile .n { font-size: 13px; color: var(--muted); }
.tile .v { font: 600 15px var(--mono); margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

/* 状态条 */
.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 1px; height: 26px; }
.bars i { display: block; border-radius: 1px; background: var(--ok); opacity: .85; }
.bars i.none { background: var(--ok); }
.bars i.maintenance { background: #3b82f6; }
.bars i.minor { background: #eab308; }
.bars i.major { background: #f97316; }
.bars i.critical { background: var(--bad); }
.bars i.nodata { background: var(--na-soft); }

/* 代码块 */
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font: 13px/1.7 var(--mono); margin: 0; white-space: pre; }
.copyable { position: relative; }
.copyable .btn { position: absolute; right: 8px; top: 8px; }

/* 页签 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 600; }

/* 文章 */
.article { max-width: 760px; }
.article h1 { font-size: 28px; line-height: 1.3; margin: 8px 0 8px; }
.article h2 { font-size: 20px; margin: 32px 0 10px; }
.article p, .article li { line-height: 1.85; }
.article .lede { color: var(--muted); font-size: 16px; }
.article code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.article table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article th { background: var(--surface-2); }
.crumbs { font-size: 13px; color: var(--muted); }

/* 列表卡 */
.linklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.linkcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); }
.linkcard:hover { border-color: var(--brand); text-decoration: none; }
.linkcard b { display: block; margin-bottom: 4px; }
.linkcard span { color: var(--muted); font-size: 13px; }

/* 页脚 */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 28px 16px 36px; display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 24px; font-size: 13px; }
.foot h4 { font-size: 13px; margin: 0 0 8px; }
.foot a { display: block; color: var(--muted); padding: 2px 0; }
.foot p { color: var(--muted); margin: 6px 0 0; max-width: 34ch; }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr 1fr; } }

.skeleton { color: var(--faint); }
.empty { padding: 22px 18px; color: var(--muted); font-size: 14px; }
.err { color: var(--bad); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: 14px; z-index: 50; }

/* 语言切换 */
.langsw { position: relative; display: flex; align-items: center; gap: 4px; flex: none; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 4px 0 8px; height: 32px; background: var(--surface); cursor: pointer; }
.langsw:hover, .langsw:focus-within { border-color: var(--brand); color: var(--ink); }
.langsw select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; padding: 0 18px 0 0; cursor: pointer; outline: none; box-shadow: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 6px top 50%, right 2px top 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.langsw select:focus { box-shadow: none; }
.langsw option { color: #16202b; background: #fff; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px !important; }
.foot-langs a { display: inline; padding: 0; }
.foot-langs a[aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) { .topbar-in { gap: 10px; } .logo span { display: none; } }

/* App Store */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.appcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); }
.appcard:hover { border-color: var(--brand); text-decoration: none; }
.appcard img { width: 64px; height: 64px; border-radius: 14px; background: var(--surface-2); }
.appcard .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appcard .dev { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appcard .price { margin-top: 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.appcard .old { color: var(--faint); text-decoration: line-through; }
.appcard .new { color: var(--ok); font-weight: 700; }
.appcard .meta { color: var(--faint); font-size: 12px; margin-top: 4px; }
.appcard.ended { opacity: .55; }
.ai-ip { border-left: 1px solid var(--line); }
@media (max-width: 820px) { .ai-ip { border-left: 0; border-top: 1px solid var(--line); } }
/* 服务状态 */
.svc { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; }
.svc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.svc-top b { font-weight: 600; }
.svc-top .r { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.svc details { margin-top: 8px; font-size: 13px; }
.svc summary { cursor: pointer; color: var(--muted); }
.comp { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
/* 卡片生成器 */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.theme { border: 2px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; background: var(--surface); font: inherit; font-size: 12px; color: var(--ink); text-align: left; }
.theme.on { border-color: var(--brand); }
.theme .sw { height: 22px; border-radius: 4px; margin-bottom: 6px; display: flex; align-items: flex-end; padding: 3px; }
.theme .sw span { width: 40%; height: 4px; border-radius: 2px; }
.opts { display: grid; grid-template-columns: 110px 1fr; gap: 12px 14px; align-items: center; }
.opts label { color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { font: inherit; font-size: 13px; border: 0; background: var(--surface); color: var(--ink); padding: 6px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }
.preview { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; border-radius: 8px; padding: 24px; display: grid; place-items: center; min-height: 200px; overflow: auto; }
.preview img { max-width: 100%; height: auto; }
@media (max-width: 560px) { .opts { grid-template-columns: 1fr; gap: 4px; } }
.hero.hero-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 820px) { .hero.hero-2 { grid-template-columns: minmax(0, 1fr); } }
