:root {
  --bg: #f4f5f7;
  --surface: #fff;
  --text: #1c1e21;
  --muted: #5f6670;
  --line: #e1e4e8;
  --brand: #0b5cad;
  --brand-ink: #fff;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1b1e24;
    --text: #e8eaed;
    --muted: #a0a6ae;
    --line: #2c3038;
    --brand: #6aa8ff;
    --brand-ink: #0b1a2e;
    --warn: #f0b45a;
    --warn-bg: #3a2a10;
    --err: #ff8a80;
    --err-bg: #3b1714;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.brand { color: var(--text); font-weight: 600; text-decoration: none; }
.lang { padding: 6px 10px; border-radius: 8px; text-decoration: none; }

.intro { padding: 24px 0 8px; }
.intro h1 { margin: 0 0 6px; font-size: 1.5rem; line-height: 1.25; }
.intro p { margin: 0; color: var(--muted); }

.finder {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 0 8px;
  background: var(--bg);
}
.search input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }
.chip .n { opacity: .7; font-size: .8rem; }
.hint { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.no-js .chips, .no-js .search { display: none; }

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 8px 0 24px;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card[hidden] { display: none; }
.go {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
}
.go:hover .nm { color: var(--brand); }
.go:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.go img, .ph {
  flex: none;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.ph {
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
}
.tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nm { font-weight: 600; line-height: 1.3; }
.sub { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { flex: none; padding: 2px 8px; font-size: .75rem; border-radius: 999px; }
.st-pending { color: var(--warn); background: var(--warn-bg); }
.st-error { color: var(--err); background: var(--err-bg); }
.meta { display: flex; gap: 14px; padding: 0 14px 10px 74px; font-size: .8rem; }
.meta a { color: var(--muted); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.help { margin: 8px 0 32px; }
.help h2 { font-size: 1.1rem; }
.help details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.help summary { min-height: 48px; padding: 12px 14px; cursor: pointer; font-weight: 500; }
.help details p { margin: 0; padding: 0 14px 12px; color: var(--muted); }

.foot { border-top: 1px solid var(--line); background: var(--surface); font-size: .85rem; }
.foot-in { padding-top: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { color: var(--muted); }
.foot p { margin: 10px 0 0; }

@media (prefers-reduced-motion: no-preference) {
  .go { transition: background-color .15s; }
}
@media (hover: hover) { .go:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); } }
