* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-tap-highlight-color: transparent; }
input, textarea { user-select: text; -webkit-user-select: text; }
html, body {
  width: 100%; height: 100%;
  background: #040507;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Display", sans-serif;
  display: flex; justify-content: center; align-items: center; overflow: hidden;
}

.phone-frame {
  position: relative;
  width: 100%; max-width: 414px;
  height: 100%; max-height: 896px;
  background: #08090c;
  color: #f4f4f5;
  overflow: hidden;
  display: flex; flex-direction: column;
}

.market-page {
  flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #171923 0%, #08090c 58%);
}

.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.nav-title { font-size: 18px; font-weight: 800; color: #ffffff; letter-spacing: 0.4px; }
.nav-right-actions { display: flex; align-items: center; gap: 4px; }
.nav-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: none; color: #e4e4e7;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
}
.nav-icon-btn:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.08); }
.nav-icon-btn svg { width: 20px; height: 20px; }

.sub-tabs {
  display: flex; align-items: center; gap: 20px;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
  position: relative; background: none; border: none;
  color: #71717a; font-size: 14px; font-weight: 600;
  padding: 12px 0; white-space: nowrap; cursor: pointer;
}
.sub-tab.active { color: #ffffff; font-weight: 700; }
.sub-tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2.5px; border-radius: 2px; background: #F0B90B;
}

.filter-drawer {
  display: none; flex-direction: column; gap: 8px;
  padding: 10px 14px;
  background: rgba(18, 20, 27, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.filter-drawer.open { display: flex; }

.search-box-wrap { position: relative; display: flex; align-items: center; }
.search-inner-icon {
  position: absolute; left: 12px; width: 15px; height: 15px; color: #71717a; pointer-events: none;
}
.search-input {
  width: 100%; height: 36px; padding: 0 12px 0 34px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d0f14; color: #ffffff; font-size: 13px; outline: none;
}
.search-input:focus { border-color: #F0B90B; }

.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 16px; white-space: nowrap; cursor: pointer;
}
.chip.active {
  background: rgba(240, 185, 11, 0.16);
  border-color: #F0B90B; color: #F0B90B;
}

.market-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: none;
}
.market-grid-wrap::-webkit-scrollbar { display: none; }

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.card-item {
  position: relative;
  width: 100%;
  min-width: 0;
  background: linear-gradient(165deg, #171921 0%, #101218 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 9px;
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card-item:hover {
  transform: scale(1.02);
  border-color: rgba(240, 185, 11, 0.35);
}

.card-top-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
}
.seller-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: #a1a1aa; min-width: 0;
}
.seller-badge span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seller-avatar {
  width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; font-size: 9px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.buy-now-btn {
  background: #F0B90B; color: #090a0d; border: none; flex-shrink: 0;
  border-radius: 999px; padding: 4px 8px;
  font-size: 10px; font-weight: 800; cursor: pointer;
}
.buy-now-btn:active { transform: scale(0.94); }

/* 去掉外框固定高宽比，让外框四周 5px 内边距完全对称贴合标头与卡图 */
.psa-thumb-box {
  position: relative;
  width: 100%;
  border-radius: 9px;
  background: rgba(12, 14, 20, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  flex-shrink: 0;
}
.psa-mini-header {
  background: #ffffff; color: #111827; border: 1.5px solid #dc2626;
  border-radius: 4px; padding: 2.5px 6px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 8px; font-weight: 900; z-index: 3; flex-shrink: 0;
}
.psa-card-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 63 / 88;
  background: #141720;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.img-skeleton-loader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(110deg, #141720 18%, #232838 45%, #141720 72%);
  background-size: 220% 100%;
  animation: shimmerSkeleton 1.25s infinite linear;
  z-index: 1;
  transition: opacity 0.2s ease;
}
.img-skeleton-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.psa-real-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.psa-real-card-img.loaded {
  opacity: 1;
}

.psa-art-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  z-index: 2;
}
.card-light-sheen {
  position: absolute; inset: -40%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  pointer-events: none; z-index: 4;
}

.card-name {
  font-size: 12px; font-weight: 700; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grade-tag {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  padding: 2px 7px; border-radius: 6px;
}

.card-price-row {
  display: flex; flex-direction: column; gap: 1px; margin-top: 2px;
}
.list-price {
  font-size: 15px; font-weight: 800; color: #F0B90B;
  font-variant-numeric: tabular-nums;
}
.est-price { font-size: 10px; color: #71717a; font-variant-numeric: tabular-nums; }

.empty-state-box {
  grid-column: 1 / -1;
  text-align: center; padding: 48px 16px;
  color: #a1a1aa; font-size: 13px; line-height: 1.7;
}
.skeleton-card {
  aspect-ratio: 5 / 9.2;
  border-radius: 12px;
  background: linear-gradient(90deg, #13151c 25%, #1c1f29 50%, #13151c 75%);
  background-size: 200% 100%;
  animation: shimmerSkeleton 1.3s infinite linear;
}
@keyframes shimmerSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.bottom-nav {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 68px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 16, 0.95);
  backdrop-filter: blur(12px);
  padding: 8px 0 12px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.nav-item {
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; height: 100%; width: 100%; line-height: 1;
  color: #71717a; font-size: 11px; font-weight: 500; letter-spacing: 0.4px;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; display: block; }
.nav-item span { line-height: 1; display: block; }
.nav-item.active { color: #F0B90B; font-weight: 700; }