:root,
html[data-theme="aurora"] {
  color-scheme: dark;
  --bg: #070c18;
  --bg-soft: #0d1526;
  --surface: rgba(13, 21, 38, 0.82);
  --surface-strong: #111b30;
  --surface-hover: rgba(17, 28, 51, 0.96);
  --border: rgba(99, 102, 241, 0.2);
  --border-strong: rgba(99, 102, 241, 0.52);
  --accent: #6264ed;
  --accent-light: #a5b4fc;
  --accent-rgb: 98 100 237;
  --accent-gradient-end: #4f46e5;
  --accent-hover: #5558dc;
  --accent-hover-end: #4338ca;
  --cyan: #22d3ee;
  --cyan-rgb: 34 211 238;
  --green: #34d399;
  --green-rgb: 52 211 153;
  --gold: #fbbf24;
  --red: #fb7185;
  --text: #e2e8f0;
  --text-soft: #a8b5c9;
  --text-muted: #71819a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --header-bg: rgba(7, 12, 24, 0.9);
  --panel-bg: rgba(13, 21, 38, 0.72);
  --media-start: #101a30;
  --media-end: #182646;
  --media-deep: rgba(13, 21, 38, 0.9);
  --media-overlay: rgba(7, 12, 24, 0.82);
  --radius: 14px;
  --radius-small: 8px;
  --content: 1200px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

html[data-theme="ocean"] {
  --bg: #04131f;
  --bg-soft: #071f2d;
  --surface: rgba(7, 31, 45, 0.84);
  --surface-strong: #0b2a3b;
  --surface-hover: rgba(10, 40, 57, 0.96);
  --border: rgba(14, 165, 233, 0.24);
  --border-strong: rgba(14, 165, 233, 0.58);
  --accent: #0369a1;
  --accent-light: #7dd3fc;
  --accent-rgb: 14 165 233;
  --accent-gradient-end: #0e7490;
  --accent-hover: #075985;
  --accent-hover-end: #155e75;
  --cyan: #2dd4bf;
  --cyan-rgb: 45 212 191;
  --text: #e0f2fe;
  --text-soft: #a5c4d4;
  --text-muted: #6f91a4;
  --header-bg: rgba(4, 19, 31, 0.91);
  --panel-bg: rgba(7, 31, 45, 0.74);
  --media-start: #082536;
  --media-end: #0c3a50;
  --media-deep: rgba(7, 31, 45, 0.92);
  --media-overlay: rgba(4, 19, 31, 0.84);
}

html[data-theme="sunset"] {
  --bg: #160a12;
  --bg-soft: #26101b;
  --surface: rgba(38, 16, 27, 0.84);
  --surface-strong: #321422;
  --surface-hover: rgba(50, 20, 34, 0.96);
  --border: rgba(244, 63, 94, 0.24);
  --border-strong: rgba(244, 63, 94, 0.56);
  --accent: #be123c;
  --accent-light: #fda4af;
  --accent-rgb: 244 63 94;
  --accent-gradient-end: #c2410c;
  --accent-hover: #9f1239;
  --accent-hover-end: #9a3412;
  --cyan: #f59e0b;
  --cyan-rgb: 245 158 11;
  --green: #4ade80;
  --green-rgb: 74 222 128;
  --text: #fce7f3;
  --text-soft: #d8b4c1;
  --text-muted: #967586;
  --header-bg: rgba(22, 10, 18, 0.91);
  --panel-bg: rgba(38, 16, 27, 0.74);
  --media-start: #351524;
  --media-end: #54202a;
  --media-deep: rgba(38, 16, 27, 0.92);
  --media-overlay: rgba(22, 10, 18, 0.84);
}

html[data-theme="forest"] {
  --bg: #06120f;
  --bg-soft: #0b2119;
  --surface: rgba(11, 33, 25, 0.84);
  --surface-strong: #102c22;
  --surface-hover: rgba(15, 44, 34, 0.96);
  --border: rgba(16, 185, 129, 0.24);
  --border-strong: rgba(16, 185, 129, 0.56);
  --accent: #047857;
  --accent-light: #6ee7b7;
  --accent-rgb: 16 185 129;
  --accent-gradient-end: #0f766e;
  --accent-hover: #065f46;
  --accent-hover-end: #115e59;
  --cyan: #2dd4bf;
  --cyan-rgb: 45 212 191;
  --text: #e5f7ef;
  --text-soft: #adcdbf;
  --text-muted: #718f82;
  --header-bg: rgba(6, 18, 15, 0.91);
  --panel-bg: rgba(11, 33, 25, 0.74);
  --media-start: #0d2a20;
  --media-end: #164536;
  --media-deep: rgba(11, 33, 25, 0.92);
  --media-overlay: rgba(6, 18, 15, 0.84);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
}

.ambient-a {
  top: -28vw;
  left: -18vw;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / 0.1), transparent 68%);
}

.ambient-b {
  right: -18vw;
  bottom: -28vw;
  width: 62vw;
  height: 62vw;
  background: radial-gradient(circle, rgb(var(--cyan-rgb) / 0.065), transparent 68%);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: 62px;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.top-nav {
  display: flex;
  width: 100%;
  max-width: calc(var(--content) + 56px);
  height: 100%;
  padding: 0 28px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand em {
  color: var(--accent-light);
  font-style: normal;
}

.brand-mark {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  box-shadow: 0 0 24px rgb(var(--accent-rgb) / 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.nav-actions,
.sync-actions,
.toolbar-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.button:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--text);
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-gradient-end));
  box-shadow: 0 8px 28px rgb(var(--accent-rgb) / 0.25);
  color: #fff;
}

.button-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-hover-end));
  box-shadow: 0 10px 34px rgb(var(--accent-rgb) / 0.38);
  color: #fff;
  transform: translateY(-1px);
}

.button-compact {
  min-height: 34px;
  padding: 6px 11px;
  color: var(--text-soft);
  font-size: 12px;
}

.button-compact.is-loading svg {
  animation: spin 0.75s linear infinite;
}

.button:disabled {
  opacity: 0.55;
  transform: none;
}

.sync-strip {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: var(--content);
  min-height: 44px;
  padding: 8px 24px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.sync-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.sync-message {
  min-width: 0;
  color: var(--text-soft);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.08);
}

.status-dot.is-loading {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.08);
}

.status-dot.is-stale {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.08);
}

.api-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgb(var(--cyan-rgb) / 0.25);
  border-radius: 999px;
  background: rgb(var(--cyan-rgb) / 0.08);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.sync-time {
  white-space: nowrap;
}

main,
.site-footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 52px 24px 42px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  padding: 6px 15px;
  margin: 0 0 22px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(var(--accent-rgb) / 0.32);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.075);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.055em;
}

.hero-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.hero h1 span {
  color: var(--text);
}

.hero h1 strong {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 590px;
  margin: 0 auto 34px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}

.hero-subtitle em {
  color: var(--accent-light);
  font-style: normal;
}

.stats {
  display: grid;
  width: min(720px, 100%);
  padding: 0;
  margin: 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats div {
  min-width: 0;
  padding: 0 18px;
}

.stats div + div {
  border-left: 1px solid var(--border);
}

.stats dd {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  background-clip: text;
  color: transparent;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 850;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats dt {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.catalog {
  width: 100%;
  max-width: var(--content);
  padding: 0 24px 88px;
  margin: 0 auto;
}

.filters {
  margin-bottom: 22px;
}

.search-row {
  display: grid;
  margin-bottom: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  color: var(--text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.search-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 88px 0 45px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap input:hover {
  border-color: rgb(var(--accent-rgb) / 0.38);
}

.search-wrap input:focus,
.select-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.14);
}

.search-wrap input:focus-visible,
.select-field select:focus-visible {
  outline: 0;
}

.search-wrap kbd {
  position: absolute;
  top: 50%;
  right: 13px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  transform: translateY(-50%);
}

.select-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-field label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.select-field select {
  min-width: 112px;
  height: 50px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  outline: 0;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%), linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  color: var(--text);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}

.advanced-toggle,
.clear-filters {
  display: inline-flex;
  min-height: 38px;
  padding: 7px 12px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.advanced-toggle:hover,
.advanced-toggle[aria-expanded="true"],
.clear-filters:hover {
  border-color: var(--border-strong);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
}

.filter-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 10px;
}

.advanced-panel {
  display: grid;
  padding: 16px;
  margin: 10px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.advanced-panel legend {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.045em;
}

.filter-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.filter-chips,
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip,
.category-chip {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.category-chip {
  min-height: 40px;
  padding: 8px 15px;
  font-size: 13px;
}

.filter-chip:hover,
.category-chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.18);
  color: var(--accent-light);
}

.category-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 22px rgb(var(--accent-rgb) / 0.22);
}

.chip-count {
  margin-left: 5px;
  opacity: 0.72;
  font-size: 10px;
}

.advanced-panel .clear-filters {
  align-self: end;
  justify-self: start;
}

.category-fieldset {
  margin: 0 0 15px;
}

.catalog-toolbar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.result-summary strong {
  color: var(--text-soft);
}

.compact-select select {
  height: 40px;
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
}

.view-switcher {
  display: flex;
  padding: 3px;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: rgba(0, 0, 0, 0.22);
}

.view-button {
  display: inline-flex;
  width: 36px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.view-button:hover {
  color: var(--text);
}

.view-button.is-active {
  background: var(--accent);
  color: white;
}

.results {
  scroll-margin-top: 80px;
}

.results[aria-busy="true"] .plugin-grid:not([hidden]) {
  opacity: 0.56;
}

.skeleton-grid,
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  transition: opacity 0.18s ease;
}

.skeleton-card {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.skeleton-card::before,
.skeleton-card::after {
  position: absolute;
  content: "";
}

.skeleton-card::before {
  inset: 20px;
  border-radius: 8px;
  background: repeating-linear-gradient(to bottom, rgba(148, 163, 184, 0.075) 0 13px, transparent 13px 32px);
}

.skeleton-card::after {
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.09), transparent);
  animation: shimmer 1.45s linear infinite;
  transform: translateX(-100%);
}

.plugin-grid.view-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.plugin-grid.view-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.plugin-card {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.plugin-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.plugin-card.is-top-one {
  border-color: rgba(251, 191, 36, 0.45);
}

.plugin-card.is-top-two {
  border-color: rgba(168, 181, 201, 0.42);
}

.plugin-card.is-top-three {
  border-color: rgba(249, 115, 22, 0.38);
}

.plugin-content {
  display: flex;
  min-width: 0;
  height: 100%;
  padding: 20px;
  flex-direction: column;
  gap: 13px;
}

.plugin-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--media-start), var(--media-end));
}

.plugin-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}

.plugin-media img.is-avatar {
  padding: clamp(18px, 5%, 34px);
  background: radial-gradient(circle at center, rgb(var(--accent-rgb) / 0.2), transparent 62%);
  object-fit: contain;
}

.plugin-card:hover .plugin-media img {
  transform: scale(1.035);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, rgb(var(--cyan-rgb) / 0.16), transparent 36%), linear-gradient(135deg, rgb(var(--accent-rgb) / 0.28), var(--media-deep));
  color: rgba(226, 232, 240, 0.76);
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
}

.plugin-media.has-image .image-placeholder {
  display: none;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, var(--media-overlay));
  pointer-events: none;
}

.media-rank {
  position: absolute;
  bottom: 12px;
  left: 14px;
}

.plugin-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.plugin-title-group {
  min-width: 0;
  flex: 1;
}

.plugin-name-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.badges {
  display: contents;
}

.plugin-badge-group {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.plugin-name {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  flex: 0 1 auto;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  font-weight: 780;
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.plugin-title-link {
  color: inherit;
  text-decoration: none;
}

.plugin-title-link:hover {
  color: var(--accent-light);
}

.owner-line {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.owner-line a {
  color: var(--text-soft);
  text-decoration: none;
}

.owner-line a:hover,
.site-footer a:hover,
.dialog-link:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.rank-badge {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgb(var(--accent-rgb) / 0.11);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
}

.rank-badge.gold {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold);
}

.rank-badge.silver {
  background: rgba(168, 181, 201, 0.14);
  color: #cbd5e1;
}

.rank-badge.bronze {
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  padding: 3px 8px;
  align-items: center;
  max-width: 100%;
  flex: 0 0 auto;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-language {
  border-color: rgb(var(--cyan-rgb) / 0.22);
  background: rgb(var(--cyan-rgb) / 0.09);
  color: var(--cyan);
}

.badge-verified {
  border-color: rgb(var(--green-rgb) / 0.24);
  background: rgb(var(--green-rgb) / 0.1);
  color: var(--green);
}

.plugin-description {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.plugin-description-secondary {
  margin: -6px 0 0;
  overflow: hidden;
  display: -webkit-box;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.plugin-stats {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-wrap: wrap;
  gap: 8px 15px;
}

.plugin-stats div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.plugin-stats dt {
  color: var(--text-muted);
  font-size: 11px;
}

.plugin-stats dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.install-command,
.command-box {
  display: flex;
  min-width: 0;
  padding: 10px 10px 10px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgb(var(--accent-rgb) / 0.2);
  border-radius: var(--radius-small);
  background: rgba(0, 0, 0, 0.28);
}

.install-command code,
.command-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  min-height: 34px;
  padding: 6px 10px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.copy-button:hover {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.12);
  color: var(--accent-light);
}

.copy-button.is-copied {
  border-color: var(--green);
  color: var(--green);
}

.plugin-footer {
  display: flex;
  margin-top: auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.updated-at {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.card-link,
.card-action {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.card-link:hover,
.card-action:hover {
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.1);
  color: var(--accent-light);
}

.card-action.primary-action {
  border-color: rgb(var(--accent-rgb) / 0.42);
  color: var(--accent-light);
}

.gallery-card .plugin-content {
  padding: 17px;
}

.gallery-card .plugin-description {
  -webkit-line-clamp: 2;
}

.gallery-card .rank-badge {
  width: 36px;
  height: 36px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.list-card {
  min-height: 74px;
  flex-direction: row;
  align-items: center;
}

.list-card .plugin-content {
  display: grid;
  padding: 12px 15px;
  align-items: center;
  grid-template-columns: minmax(210px, 1fr) minmax(230px, 1.35fr) auto auto;
  gap: 14px;
}

.list-card .plugin-heading {
  align-items: center;
}

.list-card .rank-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.list-card .plugin-name {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card .owner-line {
  display: none;
}

.list-card .plugin-description {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card .plugin-stats {
  flex-wrap: nowrap;
}

.list-card .plugin-stats div:nth-child(n + 3) {
  display: none;
}

.list-card .card-actions {
  flex-wrap: nowrap;
}

.inline-error,
.empty-state {
  padding: 42px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-bg);
  text-align: center;
}

.inline-error {
  display: grid;
  margin-bottom: 18px;
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  text-align: left;
}

.state-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(251, 113, 133, 0.32);
  border-radius: 50%;
  background: rgba(251, 113, 133, 0.1);
  color: var(--red);
  font-weight: 900;
}

.inline-error h3,
.empty-state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.inline-error p,
.empty-state p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.empty-state {
  padding-block: 72px;
}

.empty-state svg {
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.empty-state .button {
  margin-top: 20px;
}

.pagination {
  display: flex;
  margin-top: 28px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.page-button,
.page-ellipsis {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  padding: 7px 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.page-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
}

.page-button.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.page-button:disabled {
  opacity: 0.42;
}

.page-ellipsis {
  border-color: transparent;
  background: transparent;
}

.install-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(86vh, 780px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 17px;
  background: var(--bg-soft);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.64);
  color: var(--text);
}

.install-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dialog-header {
  display: flex;
  padding: 19px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.dialog-eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-header h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
}

.dialog-close {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  font-size: 22px;
  line-height: 1;
}

.dialog-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

.dialog-body {
  max-height: calc(min(86vh, 780px) - 82px);
  padding: 20px 22px 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.dialog-description {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
}

.dialog-meta {
  display: flex;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 7px;
}

.dialog-step-list {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 17px;
  list-style: none;
}

.dialog-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}

.step-number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.step-content {
  min-width: 0;
}

.step-content h3 {
  margin: 3px 0 7px;
  font-size: 13px;
}

.step-content p {
  margin: 0 0 9px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.command-box code {
  overflow: auto;
  text-overflow: clip;
  white-space: nowrap;
  scrollbar-width: thin;
}

.trust-note {
  padding: 12px 14px;
  margin-top: 19px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: var(--radius-small);
  background: rgba(52, 211, 153, 0.07);
  color: #a7f3d0;
  font-size: 12px;
  line-height: 1.6;
}

.dialog-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 1000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100% - 36px));
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.toast.is-error {
  border-color: rgba(251, 113, 133, 0.45);
}

.copy-fallback {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.site-footer {
  display: flex;
  min-height: 90px;
  padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.site-footer a {
  color: var(--text-soft);
  text-decoration: none;
}

.noscript-message {
  position: fixed;
  z-index: 1100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border: 1px solid rgba(251, 113, 133, 0.4);
  border-radius: 10px;
  background: #341522;
  color: #fecdd3;
  text-align: center;
}

.not-found-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.not-found {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(30px, 7vw, 60px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.not-found-code {
  margin: 0;
  background: linear-gradient(135deg, var(--accent-light), var(--cyan));
  background-clip: text;
  color: transparent;
  font-size: clamp(72px, 18vw, 128px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.9;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.not-found h1 {
  margin: 24px 0 10px;
  font-size: clamp(22px, 5vw, 30px);
}

.not-found p:not(.not-found-code) {
  margin: 0 0 24px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.38; }
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1023px) {
  .skeleton-grid,
  .plugin-grid,
  .plugin-grid.view-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-card .plugin-content {
    grid-template-columns: minmax(200px, 1fr) minmax(150px, 1fr) auto;
  }

  .list-card .plugin-stats {
    display: none;
  }
}

@media (max-width: 767px) {
  .site-header {
    height: 58px;
  }

  .top-nav {
    padding-inline: 16px;
  }

  .sync-strip {
    padding-inline: 16px;
  }

  .hero {
    padding: 40px 16px 32px;
  }

  .catalog {
    padding-inline: 16px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .scope-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .scope-field select {
    width: 100%;
  }

  .advanced-panel {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .skeleton-grid,
  .plugin-grid,
  .plugin-grid.view-gallery {
    grid-template-columns: 1fr;
  }

  .list-card {
    min-height: 0;
  }

  .list-card .plugin-content {
    display: flex;
    padding: 15px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .list-card .plugin-description {
    white-space: normal;
  }

  .list-card .card-actions {
    align-self: flex-end;
  }

  .inline-error {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .inline-error .button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .nav-topics span {
    display: none;
  }

  .nav-topics {
    width: 42px;
    padding-inline: 0;
  }

  .sync-strip {
    padding-block: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .sync-main {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sync-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0;
  }

  .stats div {
    padding: 14px 10px;
  }

  .stats div + div {
    border-left: 0;
  }

  .stats div:nth-child(even) {
    border-left: 1px solid var(--border);
  }

  .stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .plugin-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .install-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-body {
    max-height: calc(100dvh - 102px);
    padding-inline: 16px;
  }

  .dialog-header {
    padding-inline: 16px;
  }
}

@media (max-width: 479px) {
  .brand {
    gap: 7px;
    font-size: 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .nav-actions .button-primary {
    padding-inline: 10px;
  }

  .api-badge,
  .search-wrap kbd {
    display: none;
  }

  .search-wrap input {
    padding-right: 14px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero-subtitle br {
    display: none;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .compact-select {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .compact-select select {
    width: 100%;
    min-width: 0;
  }

  .page-size-field {
    grid-column: 1 / -1;
  }

  .theme-field {
    grid-column: 1 / -1;
  }

  .view-switcher {
    align-self: end;
    grid-column: 2;
    grid-row: 1;
  }

  .install-command,
  .command-box {
    align-items: stretch;
    flex-direction: column;
  }

  .install-command code,
  .command-box code {
    width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .copy-button {
    align-self: flex-start;
  }

  .inline-error {
    padding: 28px 18px;
  }

  .pagination {
    gap: 4px;
  }

  .page-button,
  .page-ellipsis {
    min-width: 38px;
  }
}

@media (max-width: 359px) {
  .nav-topics {
    display: none;
  }

  .top-nav {
    padding-inline: 12px;
  }

  .brand > span:last-child {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .category-chip,
  .filter-chip {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
