/* Homepage layout aligned with the provided light Skill marketplace reference. */
:root {
  --primary: #5b55d9;
  --primary-hover: #4943c2;
  --primary-soft: #f0efff;
  --cyan: #1d9fa8;
  --success: #248f78;
  --danger: #b84d63;
  --bg: #f5f7fb;
  --bg-soft: #f1f2f7;
  --surface: #ffffff;
  --text: #202431;
  --text-muted: #6c7180;
  --text-faint: #a0a5b1;
  --border: #e6e8ee;
  --border-strong: #d6d9e2;
  --shadow-sm: 0 2px 8px rgba(43, 49, 76, 0.05);
  --shadow-md: 0 14px 32px rgba(53, 59, 96, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  background: linear-gradient(110deg, #f3f1ff 0%, #f8f9fc 48%, #effbf8 100%);
  font-family: "Avenir Next", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body::before {
  z-index: 0;
  opacity: 0.22;
  background-image: linear-gradient(rgba(91, 85, 217, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 85, 217, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - 1400px) / 2));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(220, 223, 234, 0.84);
  box-shadow: 0 1px 8px rgba(43, 49, 76, 0.04);
}

.brand-copy strong { color: var(--text); }
.brand-copy small { color: var(--text-faint); letter-spacing: 0.08em; }
.nav-link { color: var(--text-muted); }
.nav-link:hover, .nav-link.is-active { color: var(--primary); border-color: var(--primary); }
.topbar-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-faint); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #50b794; box-shadow: 0 0 0 4px rgba(80, 183, 148, 0.12); }

#market-view { position: relative; z-index: 1; max-width: 1400px; padding: 0 28px 70px; }
.market-intro {
  min-height: 520px;
  margin: 0 -28px;
  padding: 56px 28px 34px;
  display: block;
  color: var(--text);
  background: transparent;
  border-bottom: 0;
}
.market-intro::after { display: none; }
.market-intro > div { z-index: auto; }
.hero-copy { text-align: center; }
.market-intro .eyebrow { color: var(--primary); letter-spacing: 0.1em; }
.market-intro h1 { margin: 12px auto 0; max-width: 780px; color: var(--text); font-size: clamp(34px, 4vw, 48px); font-weight: 750; line-height: 1.22; }
.market-intro h1 span { color: var(--primary); }
.intro-copy { max-width: 720px; margin: 14px auto 0; color: var(--text-muted); font-size: 14px; }
.catalog-pulse { display: none; }

.hero-install { width: min(760px, 100%); margin: 30px auto 0; padding: 0 18px 18px; background: rgba(255, 255, 255, 0.96); border: 1px solid rgba(221, 224, 234, 0.94); border-radius: 15px; box-shadow: 0 20px 48px rgba(71, 75, 118, 0.12); text-align: left; }
.hero-install-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); }
.hero-install-tabs { display: flex; align-self: stretch; gap: 4px; }
.hero-install-tab { min-height: 42px; align-self: center; padding: 0 14px; color: var(--text-muted); background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 750; }
.hero-install-tab.is-active { color: var(--primary); background: var(--primary-soft); }
.hero-install-more { color: var(--primary); font-size: 11px; font-weight: 750; white-space: nowrap; }
.hero-install-more span { margin-left: 4px; font-size: 18px; line-height: 0; vertical-align: -1px; }
.hero-command-list { display: grid; gap: 10px; padding-top: 18px; }
.hero-command { min-height: 68px; padding: 12px 12px 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fbfbfd; border: 1px solid #e5e7ee; border-radius: 11px; }
.hero-command > div { min-width: 0; }
.hero-step { display: block; margin-bottom: 6px; color: var(--text-faint); font-size: 10px; }
.hero-command code { display: block; overflow: hidden; color: #313541; text-overflow: ellipsis; white-space: nowrap; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.hero-copy-button { width: 31px; height: 31px; flex: 0 0 auto; color: var(--text-muted); background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 14px; }
.hero-copy-button:hover { color: var(--primary); border-color: #bcb9ef; background: var(--primary-soft); }

.search-band { position: relative; z-index: 2; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 13px 13px 0 0; background: rgba(255, 255, 255, 0.97); box-shadow: var(--shadow-sm); }
.search-field { height: 58px; padding-left: 18px; border: 0; border-radius: 13px 0 0 0; box-shadow: none; }
.search-field:focus-within { box-shadow: inset 0 0 0 2px rgba(91, 85, 217, 0.16); }
.search-field kbd { display: none; }
.sort-control { height: 38px; margin-right: 0; border-color: var(--border); border-radius: 8px; }
.sort-button { min-width: 72px; }
.sort-button.is-active { color: var(--primary); box-shadow: var(--shadow-sm); }
.search-publish { min-height: 38px; padding: 0 16px; border-radius: 999px; box-shadow: 0 8px 18px rgba(91, 85, 217, 0.22); }
.band-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-right: 16px; }

.market-layout { position: relative; z-index: 1; padding-top: 0; display: block; }
.filters { position: static; min-height: 54px; padding: 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; background: rgba(255, 255, 255, 0.97); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 13px 13px; box-shadow: var(--shadow-sm); }
.filter-heading { flex: 0 0 auto; margin: 0; }
.filter-heading strong { color: var(--text-faint); font-size: 11px; font-weight: 700; line-height: 30px; }
.filter-heading .text-button { display: none; }
.filters fieldset { min-width: 0; margin: 0; padding: 8px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; border: 0; }
.filters legend { display: none; }
.filter-options { display: flex; flex-wrap: wrap; gap: 5px; overflow: hidden; }
/* 标签行：分类下方独立一行（order 2 确保作者选择仍在第一行右侧） */
.tag-filter-group { order: 2; flex-basis: 100%; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 2px 0 10px; border-bottom: 0; }
.tag-filter-group .filter-label { flex: 0 0 auto; margin: 0; }
.tag-filter-options { min-width: 0; }
.filter-option { min-height: 30px; padding: 0 10px; gap: 0; color: var(--text-muted); background: transparent; border-radius: 999px; font-size: 11px; }
.filter-option:hover { color: var(--primary); background: var(--primary-soft); }
.filter-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filter-option input:checked + span { color: var(--primary); font-weight: 750; }
.filter-option span:last-child { margin-left: 0; color: inherit; font-size: inherit; }
.topbar-actions { display: flex; justify-content: flex-end; align-items: center; justify-self: end; }
.author-filter-group {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.author-filter-label { font-weight: 700; color: var(--text-faint); }
.author-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.author-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.filter-note { display: none; }
.catalog { min-width: 0; padding-top: 22px; }
.result-bar { min-height: 34px; }
.result-bar p { color: var(--text-muted); font-size: 12px; }
.filter-toggle { display: none; }

.skill-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.skill-card { min-height: 248px; padding: 20px; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 4px 14px rgba(53, 59, 96, 0.045); }
.skill-card:hover { transform: translateY(-3px); border-color: #c2c1e7; box-shadow: var(--shadow-md); }
.skill-icon { width: 40px; height: 40px; border-radius: 10px; }
.skill-icon.coral { color: #b35552; background: #f9e9eb; }
.skill-icon.mint { color: #248f78; background: #e5f5ef; }
.skill-icon.amber { color: #a47433; background: #fbf1de; }
.skill-icon.plum { color: #6d63af; background: #eeeaff; }
.skill-icon.graphite { color: #657080; background: #edf0f4; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-top-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.card-top-main h2, .card-title, .card-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.card-top .card-stats { margin-top: 2px; }
.card-category { color: var(--text-faint); font-size: 11px; font-weight: 600; white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card-heading { margin-top: 15px; }
.card-description { min-height: 64px; margin: 9px 0 10px; font-size: 12px; line-height: 1.65; }
.card-tags { min-height: 22px; display: flex; flex-wrap: wrap; gap: 5px; }
.card-tag { padding: 3px 7px; color: #8b909c; background: #f4f5f8; border: 1px solid #eceef2; border-radius: 5px; font-size: 9px; line-height: 1.3; }
.card-footer { padding-top: 12px; border-top: 1px solid var(--border); font-size: 10px; }

.detail-view { background: var(--bg); }
.detail-topbar { background: rgba(255, 255, 255, 0.96); border-bottom-color: var(--border); color: var(--text); }
.detail-brand span { color: var(--text-faint); }
.icon-button:hover { color: var(--primary); background: var(--primary-soft); }
.detail-summary { border-right-color: var(--border); }
.detail-category { color: var(--primary); }
.detail-tabs { background: var(--bg); border-bottom-color: var(--border-strong); }
.detail-tab.is-active, .install-method-tab.is-active { color: var(--primary); border-color: var(--primary); }
.skill-install-card { border-radius: 13px; box-shadow: var(--shadow-sm); }
.install-platform { color: var(--primary); background: var(--primary-soft); border-radius: 999px; }
.install-code-block { border-radius: 10px; }
.install-card-footer { background: var(--bg-soft); }

@media (max-width: 1240px) {
  .skill-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .skill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  #market-view { padding: 0 16px 50px; }
  .topbar { min-height: 60px; padding: 0 16px; grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .topbar-status { font-size: 0; }
  .topbar-status .status-dot { width: 8px; height: 8px; }
  .market-intro { min-height: 510px; margin: 0 -16px; padding: 38px 16px 24px; }
  .market-intro h1 { font-size: 34px; }
  .intro-copy { font-size: 13px; }
  .hero-install { margin-top: 26px; padding: 0 12px 12px; }
  .hero-install-head { align-items: flex-start; flex-direction: column; gap: 0; padding: 10px 0 0; }
  .hero-install-tabs { width: 100%; overflow-x: auto; }
  .hero-install-tab { padding: 0 11px; white-space: nowrap; }
  .hero-install-more { padding: 0 10px 10px; }
  .hero-command { align-items: flex-start; }
  .hero-command code { white-space: normal; overflow-wrap: anywhere; }
  .search-band { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; border-radius: 12px 12px 0 0; }
  .search-field { width: 100%; flex: 1 1 100%; border-radius: 12px 12px 0 0; }
  .sort-control { flex: 1; margin: 0 0 10px 10px; }
  .sort-button { min-width: 0; flex: 1; }
  .band-actions { margin: 0 10px 10px; gap: 8px; }
  .filters { border-radius: 0 0 12px 12px; gap: 9px; }
  .filter-heading { flex: 0 0 auto; margin: 0; }
  .filters fieldset { width: auto; flex: 1; min-width: 0; align-items: flex-start; }
  .filters legend { display: none; }
  .filter-options { flex: 1; }
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .skill-card { min-height: 238px; padding: 16px; }
}
@media (max-width: 500px) {
  .skill-grid { grid-template-columns: 1fr; }
  .skill-card { min-height: 220px; }
}

.subscribe-user-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 14px;
}

.subscribe-user-card strong {
  color: var(--primary);
  font-weight: 600;
}

.card-author {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.author-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.author-avatar-initial {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-stats {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11px;
}

.stat-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  stroke: currentColor;
}

.stat-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-muted);
}





/* 市场与详情共用一个账户入口，订阅作为账户设置呈现。 */
.detail-account { display: flex; justify-content: flex-end; justify-self: end; min-width: 44px; }
.auth-user { width: 44px; height: 44px; padding: 4px; justify-content: center; border: 1px solid transparent; }
.auth-user:hover, .auth-user[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--border); }
.auth-user .auth-avatar { width: 34px; height: 34px; flex-shrink: 0; }
.auth-dropdown { width: 272px; max-width: calc(100vw - 24px); padding: 8px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-md); }
.auth-profile { display: grid; gap: 4px; padding: 10px 12px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.auth-profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.auth-profile > span { color: var(--text-muted); font-size: 11px; }
.auth-dropdown button { min-height: 44px; color: var(--text); }
.auth-dropdown .subscription-menu-button { display: flex; align-items: center; gap: 10px; padding: 12px 10px; }
.subscribe-icon { display: flex; align-items: center; flex-shrink: 0; color: var(--text-muted); }
.subscription-menu-button > span:last-child { display: grid; gap: 5px; }
.subscription-menu-button small { color: var(--text-muted); font-size: 10px; line-height: 1.5; }
.subscription-menu-button.is-subscribed .subscribe-text, .subscription-menu-button.is-subscribed .subscribe-icon { color: var(--success); }
#auth-logout { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; }
