/* DSH 插件市场 · site styles
   跟随 GitHub 亮/暗主题的中性色，不抢内容。 */

:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-inset: #f0f3f6;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --fg-faint: #818b98;
  --border: #d1d9e0;
  --border-strong: #b7c0ca;
  --accent: #0969da;
  --accent-fg: #ffffff;
  --accent-soft: #ddf4ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(31, 35, 40, .08);
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #151b23;
    --bg-inset: #1c2128;
    --fg: #e6edf3;
    --fg-muted: #9198a1;
    --fg-faint: #6e7681;
    --border: #3d444d;
    --border-strong: #59636e;
    --accent: #4493f8;
    --accent-fg: #0d1117;
    --accent-soft: #121d2f;
    --shadow: 0 1px 3px rgba(1, 4, 9, .5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 15px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, #0052d9 0 50%, transparent 50%),
    linear-gradient(135deg, transparent 0 50%, #00b42a 50%),
    linear-gradient(45deg, #f7ba1e 0 50%, #8b5cf6 50%);
  box-shadow: var(--shadow);
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
}

.lang-btn {
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.lang-btn:hover { color: var(--fg); }

.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

/* ---------- hero ---------- */

.hero { padding: 52px 0 28px; }

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.hero-tagline {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 62ch;
}

.hero-note {
  margin: 0;
  font-size: 13px;
  color: var(--fg-faint);
}

/* ---------- plugin cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding-bottom: 48px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}

.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 10px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: none;
  background: var(--bg-subtle);
  object-fit: contain;
}

.card-titles { min-width: 0; }

.card-name {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.card-pkg {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--fg-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.card-summary {
  margin: 0;
  padding: 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--fg-muted);
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px 0;
}

.tag {
  font-size: 11px;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-subtle);
}

.card-actions {
  display: flex;
  gap: 8px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.btn {
  font: inherit;
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn:hover { border-color: var(--border-strong); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost { background: transparent; }

/* ---------- detail panel (same page) ---------- */

.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 40, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 30;
}

.detail-backdrop.open { opacity: 1; pointer-events: auto; }

.detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 100%);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 28px rgba(31, 35, 40, .14);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
  z-index: 31;
  display: flex;
  flex-direction: column;
}

.detail.open { transform: translateX(0); }

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.detail-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  flex: none;
  background: var(--bg-subtle);
  object-fit: contain;
}

.detail-heading { flex: 1; min-width: 0; }

.detail-name { margin: 0; font-size: 19px; line-height: 1.3; }

.detail-pkg {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--fg-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.detail-close {
  font: inherit;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  cursor: pointer;
  flex: none;
}

.detail-close:hover { border-color: var(--border-strong); color: var(--fg); }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 48px;
  -webkit-overflow-scrolling: touch;
}

.detail-section { margin-bottom: 26px; }

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-section p { margin: 0 0 10px; font-size: 14px; line-height: 1.75; }
.detail-section ul { margin: 0 0 10px; padding-left: 22px; font-size: 14px; line-height: 1.75; }
.detail-section li { margin-bottom: 5px; }
.detail-section strong { font-weight: 650; }
.detail-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  padding: .15em .4em;
  border-radius: 5px;
  background: var(--bg-inset);
}

.detail-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.detail-table th, .detail-table td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.detail-table th { font-weight: 600; background: var(--bg-subtle); }
.detail-table td:first-child { white-space: nowrap; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }

.shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-subtle);
}

.shot img { display: block; width: 100%; height: auto; }

.shot figcaption {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
}

.install-block { margin-bottom: 26px; }

.install-block h3 { margin: 0 0 10px; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

.steps { margin: 0 0 12px; padding-left: 22px; font-size: 14px; line-height: 1.8; }

pre.cmd {
  position: relative;
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  overflow-x: auto;
}

pre.cmd code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: none;
  padding: 0;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  font: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
}

pre.cmd:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }

.detail-links { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 6px; }

/* ---------- footer ---------- */

.footer {
  padding: 24px 20px 40px;
  border-top: 1px solid var(--border);
  color: var(--fg-faint);
  font-size: 13px;
}

.footer a { color: var(--fg-muted); }

@media (max-width: 560px) {
  .hero { padding: 34px 0 20px; }
  .card-actions { flex-wrap: wrap; }
  .detail-body { padding: 18px 16px 40px; }
  .detail-head { padding: 16px 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .detail, .detail-backdrop, .btn { transition: none; }
}
