:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2230;
  --muted: #5d6677;
  --line: #e2e6ec;
  --accent: #2f6fde;
  --accent-text: #ffffff;
  --chip: #eef2f8;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 16px rgb(16 24 40 / 6%);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151922;
    --panel: #1e2430;
    --text: #e6e9ef;
    --muted: #9aa3b4;
    --line: #2e3646;
    --accent: #4f8bf0;
    --chip: #283041;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--chip); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand svg { width: 26px; height: 26px; fill: var(--accent); }
nav { display: flex; gap: 22px; font-size: 15px; }
nav a { color: var(--muted); }

.hero { padding: 40px 0 18px; }
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.01em; }
.hero p { margin: 0; color: var(--muted); max-width: 720px; font-size: 17px; }

.tools { display: flex; gap: 10px; margin: 18px 0 10px; }
.tools input, .tools select {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.tools input { flex: 1; min-width: 0; }
.tools input:focus, .tools select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag {
  font: inherit; font-size: 13px; color: var(--muted); background: var(--chip);
  border: 1px solid transparent; border-radius: 999px; padding: 3px 11px; cursor: pointer;
}
.tag.on { background: var(--accent); color: var(--accent-text); }
.count { color: var(--muted); font-size: 14px; margin: 8px 0 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.pic { display: block; aspect-ratio: 16 / 9; background: var(--chip); position: relative; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .ph {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-size: 54px; font-weight: 700; color: var(--muted); opacity: 0.6;
}
.pic.empty img { display: none; }
.pic.empty .ph { display: flex; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.body h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.body h3 .name { color: var(--text); }
.ver { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.by { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.by img { width: 20px; height: 20px; border-radius: 50%; }
.desc {
  margin: 0 0 8px; font-size: 15px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.entries { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.chips span { font-size: 12px; background: var(--chip); color: var(--muted); border-radius: 999px; padding: 1px 9px; }
.meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: auto; padding-bottom: 12px; }
.actions { display: flex; gap: 8px; }
.btn {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); color: var(--text); background: var(--panel);
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.disabled { opacity: 0.45; pointer-events: none; }

.info {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 24px 14px; margin-top: 34px;
}
.info h2 { font-size: 22px; margin: 16px 0 6px; }
.info li { margin: 4px 0; }
.note { color: var(--muted); font-size: 14px; }
.empty-list { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 40px 0; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; padding-top: 30px; padding-bottom: 40px; }

@media (max-width: 640px) {
  nav a:not(:last-child) { display: none; }
  .tools { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
}

/* Plugin pages */
a.brand { color: inherit; }
a.brand:hover { text-decoration: none; }
.page { padding-top: 18px; padding-bottom: 30px; }
.page .crumbs { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.page h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; }
.page h1 .ver { color: var(--muted); font-size: 16px; font-weight: 500; }
.page .lead { font-size: 18px; color: var(--muted); margin: 0 0 16px; max-width: 760px; }
.page .actions { display: flex; gap: 10px; margin-bottom: 20px; max-width: 440px; }
.page .hero-pic { display: block; max-width: 100%; max-height: 460px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow); margin-bottom: 8px; }
.page .cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 28px; }
.page .facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 24px; }
.page .facts dt { color: var(--muted); }
.page .facts dd { margin: 0; }
.page aside .chips { margin-top: 14px; }
.page .more ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.page .more li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.page .more li a { font-weight: 600; display: block; }
.page .more li span { color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .page .cols { grid-template-columns: 1fr; } }
