:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1d2129;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn-soft: #fff7e6;
  --warn-border: #f5d28a;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --text: #e6e8eb;
    --muted: #9aa1ac;
    --border: #2a2f37;
    --accent: #6ea0ff;
    --accent-soft: #1b2436;
    --ok: #4ade80;
    --ok-soft: #14271c;
    --bad: #f87171;
    --bad-soft: #2c1717;
    --warn-soft: #2a2414;
    --warn-border: #5c4a1c;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.top-nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { color: var(--muted); white-space: nowrap; font-size: 14px; }
.top-nav a:hover { color: var(--text); text-decoration: none; }

.hero { text-align: center; padding: 48px 0 24px; }
.hero h1 { font-size: 28px; font-weight: 700; letter-spacing: .5px; }
.hero .sub { color: var(--muted); margin-top: 6px; }

.search { display: flex; max-width: 680px; margin: 28px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.search:focus-within { border-color: var(--accent); }
.search select { border: 0; background: transparent; color: var(--text); padding: 0 8px 0 18px; font-size: 14px; outline: none; cursor: pointer; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 14px 12px; font-size: 16px; outline: none; border-left: 1px solid var(--border); }
.search button { border: 0; background: var(--accent); color: #fff; padding: 0 26px; font-size: 15px; cursor: pointer; }

.status-bar { margin-top: 16px; color: var(--muted); font-size: 13px; }
.status-bar b { color: var(--ok); }
.promo { margin-top: 14px; }
.promo a { display: inline-block; padding: 4px 14px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: 14px; }

.ad { margin: 16px 0; min-height: 0; }
.notice { background: var(--warn-soft); border: 1px solid var(--warn-border); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; margin: 8px 0 8px; }

.cat { margin-top: 36px; }
.cat-head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.cat-head .count { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; }
.cat-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card.is-down { opacity: .55; }
.card-link { display: flex; flex-direction: column; padding: 14px 14px 12px; color: var(--text); height: 100%; }
.card-link:hover { text-decoration: none; }
.card-name { font-weight: 600; padding-right: 64px; }
.card-host { color: var(--muted); font-size: 12px; word-break: break-all; }
.card-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.badge { position: absolute; top: 12px; right: 12px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge[data-state="up"] { background: var(--ok-soft); color: var(--ok); }
.badge[data-state="down"] { background: var(--bad-soft); color: var(--bad); }

.gh-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gh-form input { flex: 1 1 320px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; }
.gh-form select, .gh-form button, .gh-out button { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; }
.gh-form button { background: var(--accent); border-color: var(--accent); color: #fff; }
.gh-out { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.gh-out code { flex: 1 1 320px; word-break: break-all; background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.hint code { word-break: break-all; }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { color: var(--muted); margin-top: 8px; font-size: 14px; }

.foot { margin-top: 48px; padding: 24px 0 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .top-inner { gap: 14px; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 21px; }
  .search { border-radius: 12px; }
  .search select { padding-left: 12px; max-width: 92px; }
  .search button { padding: 0 16px; }
  .grid { grid-template-columns: 1fr; }
}
