/* plugin-deck — dark theme, English UI */
:root {
  --bg: #0b0d10;
  --surface: #15181d;
  --surface-2: #1a1e25;
  --border: #22272e;
  --border-strong: #2c333d;
  --text: #e6e9ef;
  --muted: #8a93a3;
  --accent: #7c5cff;
  --accent-soft: #3a2f7d;
  --accent-fg: #ffffff;
  --success: #2ea043;
  --warning: #d29922;
  --danger: #f85149;
  --radius: 10px;
  --gap: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

button, select, input[type="search"], input[type="text"] {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="search"]:focus, input[type="text"]:focus, select:focus, button:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(11,13,16,0.96), rgba(11,13,16,0.86));
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand-mark {
  display: inline-block;
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), #2dd4bf);
  position: relative; top: 2px;
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.brand-tagline { color: var(--muted); font-size: 0.9em; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tab {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}
.tab:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.tab.active { color: var(--text); background: var(--surface); border: 1px solid var(--border); }

/* Layout */
main {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.view { display: flex; flex-direction: column; gap: 18px; }
h2 { font-size: 1.4em; margin: 0; }
h3 { font-size: 1.05em; margin: 10px 0 4px; color: var(--muted); }
.muted { color: var(--muted); }
.dot { color: var(--muted); margin: 0 6px; }

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.filters input[type="search"] { flex: 1 1 280px; min-width: 220px; }

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease;
}
.card:hover { border-color: var(--accent); }
.card:active { transform: translateY(1px); }
.card .name {
  font-weight: 600;
  font-size: 1em;
  word-break: break-word;
}
.card .desc {
  color: var(--muted);
  font-size: 0.92em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.85em;
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 0.78em;
  color: var(--text);
}
.badge.official {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}
.badge.cat {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--muted);
}
.badge.stars { background: #1f2731; border-color: #2c3741; color: #ffd166; }

/* Pagination */
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

/* What's new */
.wn-day {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 10px;
}
.wn-day h4 { margin: 0 0 6px; color: var(--muted); font-weight: 500; }
.wn-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
}
.wn-row:hover { background: var(--surface); }
.wn-row .name { font-weight: 600; min-width: 180px; }
.wn-row .desc { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Categories */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85em;
}
.chip:hover { border-color: var(--accent); }
.chip .count { color: var(--muted); margin-left: 6px; }

/* Marketplaces */
.mp-list {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.mp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-card h4 { margin: 0; font-size: 1em; }
.mp-card .stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--muted);
}
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }

/* About */
.src-list { padding-left: 18px; }
.src-list li { margin-bottom: 6px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  margin: 5vh auto;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  z-index: 1;
  max-height: 90vh;
  overflow: auto;
}
.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 10px;
}
.modal-close:hover { color: var(--text); }
.modal-card h3 { margin-top: 4px; }
.kv-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 12px 0; font-size: 0.92em; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; word-break: break-word; }
.install-snippet {
  background: #0c1015;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
  word-break: break-all;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85em;
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
  .tabs { width: 100%; margin-left: 0; }
  .brand-tagline { display: none; }
  main { padding: 16px; }
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
