/* ============================================================
   dsher.cn — plugin marketplace styles
   ============================================================ */

/* ---------- marketplace hero ---------- */
.pl-hero { padding: 72px 24px 8px; text-align: center; }
.pl-hero-inner { max-width: var(--maxw); margin: 0 auto; }
.pl-title {
  font-size: clamp(34px, 5.5vw, 52px); font-weight: 800; line-height: 1.15;
  margin: 0 0 12px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(77, 141, 255, 0.28));
}
.pl-sub { max-width: 560px; margin: 0 auto 34px; color: var(--text-dim); font-size: 16px; }

/* ---------- controls ---------- */
.pl-controls {
  max-width: 640px; margin: 0 auto 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.pl-search {
  position: relative; width: 100%;
  display: flex; align-items: center;
}
.pl-search-icon {
  position: absolute; left: 16px; width: 16px; height: 16px; color: var(--text-faint);
  pointer-events: none;
}
.pl-search-input {
  width: 100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 13px 16px 13px 42px;
  font: inherit; font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pl-search-input::placeholder { color: var(--text-faint); }
.pl-search-input:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14), 0 0 24px rgba(34, 211, 238, 0.12);
}
.pl-stats { font-family: var(--mono); font-size: 12.5px; color: var(--text-faint); }

.pl-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pl-tab {
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 20px; cursor: pointer; transition: all 0.2s;
}
.pl-tab:hover { color: var(--text); border-color: var(--border-strong); }
.pl-tab.is-active {
  color: #04070d; background: var(--grad);
  border-color: transparent; box-shadow: 0 4px 18px rgba(34, 211, 238, 0.3);
}
.pl-tab .pl-count { opacity: 0.7; font-family: var(--mono); font-size: 12px; }

/* ---------- grid ---------- */
.pl-section { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 72px; }
.pl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pl-grid > * { min-width: 0; } /* let tracks size by 1fr, not by card min-content */
.pl-card {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 20px 20px 18px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.pl-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 22px rgba(77, 141, 255, 0.1);
}

.pl-card-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pl-badge {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pl-badge--official { color: #9db8ff; background: rgba(77, 141, 255, 0.14); border: 1px solid rgba(77, 141, 255, 0.35); }
.pl-badge--community { color: #7ee7f2; background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.35); }
.pl-badge--index { color: #b9c4d8; background: rgba(147, 161, 191, 0.14); border: 1px solid rgba(147, 161, 191, 0.35); }

.pl-name {
  min-width: 0;
  font-family: var(--mono); font-weight: 700; font-size: 15.5px; line-height: 1.4;
  white-space: normal; overflow-wrap: anywhere;
}
.pl-stars { margin-left: auto; margin-top: 2px; flex-shrink: 0; font-family: var(--mono); font-size: 12.5px; color: #f5c26b; }
.pl-author { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-top: -4px; }
.pl-desc {
  margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 3.2em;
}
.pl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-tag {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  background: rgba(147, 161, 191, 0.1); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}

.pl-card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.pl-install {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: #070b13; border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px;
}
.pl-install-code {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--cyan);
  white-space: normal; overflow-wrap: anywhere;
}
.pl-copy-btn {
  flex-shrink: 0;
  font: inherit; font-family: var(--mono); font-size: 11.5px;
  color: var(--cyan); background: transparent;
  border: 1px solid rgba(34, 211, 238, 0.3); border-radius: 7px;
  padding: 3px 10px; cursor: pointer; transition: all 0.2s;
}
.pl-copy-btn:hover { background: rgba(34, 211, 238, 0.1); }
.pl-copy-btn.copied { color: #7ee7b8; border-color: rgba(126, 231, 184, 0.4); }
.pl-repo-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 8px 13px; text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pl-repo-btn:hover { border-color: var(--cyan); text-decoration: none; box-shadow: 0 0 16px rgba(34, 211, 238, 0.16); }
.pl-repo-btn .ico { width: 13px; height: 13px; }
.pl-builtin-note {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-faint);
  text-align: right;
}

.pl-empty {
  text-align: center; color: var(--text-faint);
  font-size: 15px; padding: 48px 0;
}

/* ---------- how to install ---------- */
.pl-howto { padding: 8px 24px 72px; }
.pl-howto .section-inner { max-width: var(--maxw); margin: 0 auto; }
.pl-howto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pl-howto-grid > * { min-width: 0; }
.pl-howto-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 22px 22px 20px;
}
.pl-howto-card h3 { margin: 0 0 12px; font-size: 16px; }
.pl-howto-card p { margin: 12px 0 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.65; }
.pl-howto-card p code {
  font-size: 0.92em; color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 5px; padding: 0 5px;
  overflow-wrap: anywhere;
}
.pl-code {
  margin: 0; background: #070b13; border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 14px;
  font-size: 13px; line-height: 1.6; overflow-x: auto;
}
.pl-howto-note {
  margin-top: 16px; border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); border-radius: 10px;
  background: rgba(34, 211, 238, 0.05); padding: 16px 20px;
}
.pl-howto-note p { margin: 0 0 8px; color: var(--text-dim); font-size: 13.5px; line-height: 1.7; }
.pl-howto-note p:last-child { margin-bottom: 0; }
.pl-howto-note code {
  font-size: 0.92em; color: var(--cyan);
  background: rgba(34, 211, 238, 0.08); border-radius: 5px; padding: 0 5px;
  overflow-wrap: anywhere;
}
.pl-howto-doc { font-size: 13.5px !important; overflow-wrap: anywhere; }

/* ---------- plugin detail pages (/plugins/*.html) ---------- */
.pl-name { color: inherit; text-decoration: none; }
.pl-name:hover { color: var(--cyan); text-decoration: none; }

.plp-crumb {
  max-width: var(--maxw); margin: 0 auto; padding: 30px 24px 0;
  font-family: var(--mono); font-size: 13px; color: var(--text-faint);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.plp-crumb a { color: var(--text-dim); }
.plp-crumb a:hover { color: var(--cyan); }
.plp-crumb-current { color: var(--text); }

.plp-hero { max-width: var(--maxw); margin: 0 auto; padding: 26px 24px 6px; }
.plp-name {
  margin: 14px 0 6px; font-family: var(--mono);
  font-size: clamp(26px, 4.5vw, 42px); font-weight: 800;
  line-height: 1.2; overflow-wrap: anywhere;
}
.plp-author {
  margin: 0 0 18px; font-family: var(--mono); font-size: 14px; color: var(--text-faint);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.plp-stars { color: #f5c26b; }
.plp-desc {
  max-width: 760px; margin: 0 0 18px; color: var(--text-dim);
  font-size: 16px; line-height: 1.8; overflow-wrap: anywhere;
}

.plp-section { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px; }
.plp-install { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.plp-install .pl-install { max-width: 720px; }
.plp-install-hint { margin: 0; font-size: 13px; color: var(--text-faint); }
.plp-builtin {
  margin: 0; max-width: 720px; font-family: var(--mono); font-size: 13px; color: var(--text-faint);
  border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 16px;
}

.plp-actions { max-width: var(--maxw); margin: 0 auto; padding: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.plp-more { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 72px; }
.plp-more h2 { font-size: 20px; margin: 0 0 16px; }
.plp-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plp-more-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  padding: 12px 16px; color: var(--text);
}
.plp-more-item:hover { border-color: var(--cyan); text-decoration: none; box-shadow: 0 0 16px rgba(34, 211, 238, 0.1); }
.plp-more-name {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.plp-more-stars { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: #f5c26b; }
.plp-more-all { align-self: center; font-size: 13.5px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .pl-grid { grid-template-columns: repeat(2, 1fr); }
  .pl-howto-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pl-grid { grid-template-columns: 1fr; }
  .pl-hero { padding-top: 56px; }
  .pl-desc { -webkit-line-clamp: 4; }
  .plp-more-grid { grid-template-columns: 1fr; }
}
