/* ============================================================
   玩家分享页
   ============================================================ */

.shares-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.shares-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.shares-title {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 8px;
}

.shares-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- 筛选栏 ---------- */

.shares-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 3px solid rgba(31, 29, 24, .12);
}

.cat-tabs, .sort-tabs { display: flex; gap: 7px; flex-wrap: wrap; }

.cat-tab, .sort-tab {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--panel);
  border: 2px solid rgba(31, 29, 24, .26);
  padding: 6px 12px;
  cursor: pointer;
}
.cat-tab:hover, .sort-tab:hover { border-color: var(--grass); }

.cat-tab.is-active, .sort-tab.is-active {
  background: var(--grass);
  color: #fff;
  border-color: var(--border);
}

/* ---------- 卡片网格 ---------- */

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.share-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 3px solid var(--border);
  box-shadow: var(--pixel-shadow-sm);
  overflow: hidden;
  transition: transform .12s;
}
.share-card:hover { transform: translate(-2px, -2px); }

.share-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--panel), var(--panel));
  border-bottom: 3px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.share-cover-fallback {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--stone);
  letter-spacing: 2px;
}

.share-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }

.share-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.share-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.share-tag {
  font-size: 10px;
  color: var(--grass-dark);
  background: rgba(106, 168, 79, .16);
  border: 1px solid rgba(77, 124, 55, .3);
  padding: 1px 6px;
}

.share-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 2px dashed rgba(31, 29, 24, .15);
}

.share-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--stone);
  min-width: 0;
}
.share-author .avatar { border-width: 2px; }
.share-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.share-author-name:hover { color: var(--grass-dark); text-decoration: underline; }

.share-dl {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--grass-dark);
  border: 2px solid var(--border);
  padding: 5px 11px;
  cursor: pointer;
  flex: none;
  text-decoration: none;
  display: inline-block;
}
.share-dl:hover { background: var(--grass); }

.shares-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 13px;
  color: var(--stone);
  padding: 48px 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .shares-wrap { padding: 20px 14px 56px; }
  .share-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .share-body { padding: 10px; }
  .share-name { font-size: 12px; }
  .share-desc { display: none; }
}

/* 屏幕外卡片跳过渲染（列表变长后滚动更稳） */
@supports (content-visibility: auto) {
  .share-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
  }
}
