:root {
  --bg: #150d1a;
  --card: #241a2b;
  --card2: #2c1d31;
  --input: #25192f;
  --line: #352a3e;
  --line2: #3a2d42;
  --ink: #f5f3f7;
  --muted: #a8a0b0;
  --muted2: #8e8696;
  --subtle: #7e7081;
  --violet: #8b5cf6;
  --violet2: #a855f7;
  --lav: #a78bfa;
  --lav2: #c084fc;
  --teal: #10c48e;
  --btn: #e8ddf0;
  --btn-ink: #1a0f22;
  --code: #0f0a14;
  --danger: #fca5a5;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 85% 0%, rgba(168, 85, 247, 0.30), transparent 62%),
    radial-gradient(50% 40% at 8% 18%, rgba(124, 58, 237, 0.24), transparent 60%),
    radial-gradient(70% 55% at 50% 100%, rgba(76, 42, 94, 0.38), transparent 66%),
    radial-gradient(40% 30% at 62% 45%, rgba(192, 132, 252, 0.12), transparent 60%);
}
.wrap { max-width: 1150px; margin: 0 auto; padding: 0 20px 48px; }
a { color: var(--lav2); }

/* Floating pill header */
.topbar { position: sticky; top: 16px; z-index: 20; padding: 0 16px; }
.pill {
  max-width: 1150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  padding: 0 10px 0 16px;
  border-radius: 999px;
  background: rgba(33, 25, 37, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 243, 247, 0.14);
}
.brand { color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; font-weight: 900;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: #d7d2de; text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.pill-btn {
  margin-left: auto;
  background: var(--btn); color: var(--btn-ink);
  font-size: 14px; font-weight: 700; text-decoration: none;
  padding: 9px 18px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.35);
}
.pill-btn:hover { background: #f4ecfa; }

/* Hero */
.hero { text-align: center; max-width: 800px; margin: 0 auto; padding: 72px 0 40px; }
.eyebrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lav); margin: 0 0 14px;
}
.hero h1 { font-size: 52px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 16px; }
.hero-sub { color: var(--muted); font-size: 19px; margin: 0 auto 18px; max-width: 40em; }
.hero-stats { color: var(--muted); margin: 0 0 26px; }
.hero-stats strong { color: #fff; font-size: 19px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary, .btn-secondary {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 13px 26px; border-radius: 999px; height: 48px; line-height: 22px;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 0 28px rgba(168, 85, 247, 0.4); }
.btn-primary:hover { background: #f4ecfa; }
.btn-secondary { background: rgba(44, 29, 49, 0.6); color: #fff; border: 1px solid rgba(245, 243, 247, 0.22); }
.btn-secondary:hover { background: rgba(44, 29, 49, 0.9); }

/* Layout: sidebar + list */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.sidebar, .tool-list { min-width: 0; }
.sidebar { position: sticky; top: 88px; }
.search {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--input); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; outline: none;
}
.search::placeholder { color: var(--subtle); }
.search:focus { border-color: var(--violet); }
.cat-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--subtle); margin: 20px 0 10px;
}
.cat-list { display: grid; gap: 6px; }
.cat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font: inherit; font-size: 14px; font-weight: 500; text-align: left;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 11px 14px; cursor: pointer; height: 44px;
}
.cat-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.cat-btn.active { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.cat-btn .count {
  margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.cat-btn.active .count { background: rgba(0, 0, 0, 0.25); color: #fff; }

.list-head { margin-bottom: 6px; }
.list-head h2 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 8px; }
.list-sub { color: var(--muted); margin: 0 0 4px; }
.count-line { color: var(--subtle); font-size: 14px; margin: 0 0 18px; }

/* Tool cards */
.tool {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-top: 14px; scroll-margin-top: 96px;
}
.tool:hover { border-color: var(--violet); }
.cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; font-weight: 600; color: var(--lav2); margin: 0 0 6px;
}

.tool h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.tool p { margin: 0 0 14px; color: var(--muted); }
.tool form { display: flex; flex-wrap: wrap; gap: 8px; }
.tool input, .tool select, .tool textarea {
  font: inherit; padding: 10px 12px; color: var(--ink);
  background: var(--input); border: 1px solid var(--line2); border-radius: 10px; outline: none;
}
.tool input:focus, .tool select:focus, .tool textarea:focus { border-color: var(--violet); }
.tool input::placeholder, .tool textarea::placeholder { color: var(--subtle); }
.tool form input[name="q"], .tool form input[name="id"] { flex: 1 1 16rem; min-width: 0; }
.tool form input[name="username"] { flex: 1 1 16rem; min-width: 0; }
.tool form select { flex: 1 1 12rem; }
.tool form textarea { flex: 1 1 100%; resize: vertical; }
.tool form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); flex: 1 1 10rem; }
.tool button[type="submit"] {
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--btn); color: var(--btn-ink); padding: 10px 24px; white-space: nowrap;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.28);
}
.tool button[type="submit"]:hover { background: #f4ecfa; }
.tool button:disabled { opacity: 0.6; cursor: wait; }
.results { margin-top: 16px; }
.results:empty { margin-top: 0; }
.error { color: var(--danger); background: rgba(155, 44, 44, 0.18); border: 1px solid rgba(252, 165, 165, 0.35); border-radius: 10px; padding: 10px 12px; }
.hint { color: var(--subtle); }
.hero-img { max-width: 100%; width: 340px; border: 1px solid var(--line); border-radius: 12px; background: var(--code); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.img-grid img { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--code); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; overflow-wrap: anywhere; }
dl.kv dt { font-weight: 700; color: var(--ink); }
dl.kv dd { margin: 0; color: var(--muted); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
ul.plain li { border: 1px solid var(--line); border-radius: 12px; padding: 0 0 10px; display: flex; flex-direction: column; gap: 0; overflow: hidden; overflow-wrap: anywhere; background: var(--card2); min-width: 0; }
ul.plain li img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; flex: none; background: var(--code); }
ul.plain li .card-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 0; min-width: 0; }
ul.plain li .card-text strong { overflow-wrap: anywhere; }
ul.plain li .card-text span { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
pre.draft { white-space: pre-wrap; overflow-wrap: break-word; background: var(--code); color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 10px; font-size: 14px; }
.copy-btn { font: inherit; font-weight: 700; border: 1px solid var(--line2); border-radius: 999px; background: var(--card2); color: var(--ink); padding: 8px 18px; cursor: pointer; }
.copy-btn:hover { border-color: var(--violet); }

/* Tracking */
.track-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.track-setting { font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.track-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.track-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--card2); }
.track-main { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.track-status { color: var(--lav2); font-size: 14px; }
.track-meta { color: var(--muted); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.track-actions { margin-top: 8px; }
.track-actions button { font: inherit; font-size: 13px; font-weight: 700; border: 1px solid var(--line2); border-radius: 999px; background: transparent; color: var(--danger); padding: 5px 14px; cursor: pointer; }
.track-empty { color: var(--subtle); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 56px; padding-top: 36px; }
.footer-in { display: grid; grid-template-columns: 2fr 3fr; gap: 32px; padding-bottom: 28px; }
.footer-brand p { color: var(--muted); margin: 12px 0 0; max-width: 30em; }
.footer-note p { color: var(--muted); margin: 0; font-size: 14px; }
.footer-bar {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 8px;
}
.footer-bar p { color: var(--subtle); font-size: 13px; margin: 0; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .cat-list { display: flex; overflow-x: auto; padding-bottom: 4px; max-width: 100%; }
  .cat-btn { width: auto; white-space: nowrap; }
  .hero { padding-top: 52px; }
  .hero h1 { font-size: 34px; }
  .list-head h2 { font-size: 30px; }
  .nav { display: none; }
  .footer-in { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { top: 10px; padding: 0 10px; }
  .pill { gap: 10px; height: 52px; padding: 0 8px 0 12px; }
  .brand { font-size: 16px; }
  .pill-btn { padding: 8px 14px; font-size: 13px; }
  .tool { padding: 16px; }
  .tool form > * { flex: 1 1 100%; min-width: 0; }
  .tool button[type="submit"] { width: 100%; }
  dl.kv { grid-template-columns: 1fr; gap: 0; }
  dl.kv dt { margin-top: 10px; }
  dl.kv dt:first-child { margin-top: 0; }
  .hero-img { width: 100%; }
  ul.plain li { min-width: 0; }
  ul.plain li span { min-width: 0; overflow-wrap: anywhere; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary { width: 100%; text-align: center; }
}

.num { white-space: nowrap; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.downloads a { text-decoration: none; }
