/* Atdork-DB catalog — dark, GitHub/PyPI-grade theme */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2129;
  --border: #30363d;
  --border-soft: #21262d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #3fb950;
  --accent-dim: #238636;
  --link: #58a6ff;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(1, 4, 9, .6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.pad { padding: 48px 0; }

/* ── header ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand em { font-style: normal; color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--muted); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav .gh { color: var(--text); display: flex; }

/* ── hero ───────────────────────────────────────────── */
.hero { padding: 56px 0 8px; text-align: center; }
.hero h1 {
  margin: 0 0 10px; font-size: clamp(28px, 4.4vw, 42px); line-height: 1.15;
  background: linear-gradient(100deg, #e6edf3 30%, #3fb950 75%, #58a6ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800; letter-spacing: -.5px;
}
.hero p.sub { color: var(--muted); font-size: 17px; margin: 0 auto 26px; max-width: 640px; }
.hero p.sub code { color: var(--accent); }

/* ── search ─────────────────────────────────────────── */
.search { position: relative; max-width: 660px; margin: 0 auto 30px; }
.search input {
  width: 100%; padding: 14px 52px 14px 46px; font-size: 16px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(63, 185, 80, .15); }
.search .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 12px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 4px 7px; background: var(--surface-2);
}

/* ── stats ──────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 34px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 18px; text-align: left;
}
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.stat span { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; }

/* ── chips ──────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  font: 13px/1 var(--mono); color: var(--muted); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 7px 13px; user-select: none;
  transition: all .12s;
}
.chip:hover { color: var(--text); border-color: var(--border); }
.chip.on { color: #03250c; background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ── results table ──────────────────────────────────── */
.result-bar { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 12px; color: var(--muted); font-size: 13.5px; }
.table { border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 600; padding: 11px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border-soft);
}
thead th.num { text-align: right; }
tbody td { padding: 12px 16px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: rgba(56, 139, 253, .06); }
td.pkg a { font-family: var(--mono); font-size: 13.5px; color: var(--text); font-weight: 500; }
td.pkg a:hover { color: var(--link); }
td.pkg .folder-tag { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
td.num strong { color: var(--text); font-weight: 600; }
td.desc { color: var(--muted); font-size: 13.5px; max-width: 420px; }
td.act { white-space: nowrap; text-align: right; }

/* ── buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: 500 13px/1 var(--sans); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px; transition: all .12s;
}
.btn:hover { border-color: var(--muted); background: #22272e; }
.btn.primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.copied { background: var(--accent-dim); border-color: var(--accent); color: #fff; }
.btn.big { font-size: 14px; padding: 10px 16px; }

/* ── detail view ────────────────────────────────────── */
.crumb { margin: 26px 0 8px; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--link); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-head h1 { margin: 0; font-size: clamp(21px, 3vw, 29px); font-family: var(--mono); font-weight: 700; letter-spacing: -.4px; word-break: break-all; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.badge {
  font: 600 12px/1 var(--mono); padding: 6px 10px; border-radius: 999px;
  background: rgba(63, 185, 80, .12); color: var(--accent); border: 1px solid rgba(63, 185, 80, .35);
}
.badge.gray { background: rgba(139, 148, 158, .12); color: var(--muted); border-color: var(--border); }
.detail-desc { color: var(--muted); max-width: 760px; margin: 0 0 22px; font-size: 15.5px; }

.cmd {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 14px;
}
.cmd code { flex: 1; font-size: 14.5px; color: var(--accent); overflow-x: auto; white-space: nowrap; }
.cmd .prompt { color: var(--muted); user-select: none; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 26px; }

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.card h3 {
  margin: 0; padding: 12px 16px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center;
}
.card .body { padding: 14px 16px; }
.preview {
  margin: 0; font-family: var(--mono); font-size: 12.8px; line-height: 1.75;
  color: #9ecbff; white-space: pre-wrap; word-break: break-all; max-height: 430px; overflow: auto;
}
.preview .c { color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.meta-grid div b { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.meta-grid div span { font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.related { display: flex; flex-direction: column; gap: 4px; }
.related a { font-family: var(--mono); font-size: 13.5px; padding: 7px 10px; border-radius: 7px; color: var(--text); }
.related a:hover { background: var(--surface-2); text-decoration: none; color: var(--link); }
.related span { color: var(--muted); margin-left: 8px; font-size: 12px; }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.empty b { display: block; font-size: 19px; color: var(--text); margin-bottom: 6px; }

/* ── footer ─────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border-soft); margin-top: 60px; padding: 26px 0 34px; }
.footer-inner { color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 4px 0; }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  td.desc { display: none; }
  thead th.desc-h { display: none; }
}
@media (max-width: 560px) {
  .nav a:not(.gh) { display: none; }
  td.size, th.size { display: none; }
  .hero { padding: 38px 0 4px; }
}
