﻿/* ========================================
   宝宝游戏 H5 首页原型
   主色 #0F4C81 | 辅助 #4ECDC4 | 强调 #FF6B6B
   ======================================== */

:root {
  --primary: #0F4C81;
  --primary-light: #1a6aad;
  --accent: #4ECDC4;
  --accent-glow: rgba(78, 205, 196, 0.45);
  --highlight: #FF6B6B;
  --highlight-soft: rgba(255, 107, 107, 0.12);
  --text-primary: #1a1a2e;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-page: #f0f4f8;
  --bg-card: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 2px 8px rgba(15, 76, 129, 0.06);
  --shadow-md: 0 4px 20px rgba(15, 76, 129, 0.1);
  --shadow-lg: 0 8px 32px rgba(15, 76, 129, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --nav-height: 56px;
  --bottom-nav-height: 64px;
  --beian-bar-height: 44px;
  --font-title: 22px;
  --font-subtitle: 18px;
  --font-body: 14px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ========== 骨架屏 ========== */
.skeleton-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-page);
  padding: 12px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.skeleton-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sk-nav {
  height: 44px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: linear-gradient(90deg, #e8eef4 25%, #f5f8fb 50%, #e8eef4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-banner {
  height: 180px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  background: linear-gradient(90deg, #dce6f0 25%, #eef3f8 50%, #dce6f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.sk-card {
  height: 90px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #e8eef4 25%, #f5f8fb 50%, #e8eef4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.sk-item {
  height: 70px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #e8eef4 25%, #f5f8fb 50%, #e8eef4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sk-product {
  height: 220px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, #dce6f0 25%, #eef3f8 50%, #dce6f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== App 容器 ========== */
.app-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow-x: hidden;
}

.app-container.loaded {
  opacity: 1;
}

/* ========== 1. 顶部导航栏 ========== */
.top-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  z-index: 1000;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}

.top-nav.scrolled {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(15, 76, 129, 0.08), var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
}

.brand-logo svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.search-box {
  flex: 1;
  position: relative;
  min-width: 0;
}

.search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid rgba(15, 76, 129, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.nav-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--primary);
  transition: background var(--transition), transform 0.2s ease;
}

.nav-icon-btn:active {
  transform: scale(0.92);
  background: rgba(15, 76, 129, 0.08);
}

.nav-icon-btn svg {
  width: 22px;
  height: 22px;
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--highlight);
  border-radius: 50%;
  border: 2px solid #fff;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ========== 主内容区 ========== */
.main-content {
  padding-top: var(--nav-height);
  padding-bottom: calc(var(--bottom-nav-height) + var(--beian-bar-height) + 16px);
}

.bottom-spacer {
  height: 8px;
}

/* ========== 网站备案 / 版权信息 ========== */
.site-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.site-legal-copy {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #999;
  white-space: nowrap;
}

.site-beian {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.site-beian-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: #888;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.site-beian-link:hover {
  color: #555;
}

.site-beian-icon {
  flex-shrink: 0;
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.site-legal[hidden],
.site-beian[hidden] {
  display: none !important;
}

.site-beian-link[hidden] {
  display: none !important;
}

@media (max-width: 1023px) {
  .site-legal {
    position: fixed;
    left: 50%;
    bottom: var(--bottom-nav-height);
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    z-index: 1090;
    padding: 8px 12px 6px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-top: 1px solid rgba(15, 76, 129, 0.08);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
    justify-content: center;
  }

  .site-legal-copy {
    display: none;
  }

  .site-beian {
    margin-top: 0;
    gap: 4px 10px;
  }

  .site-beian-link {
    font-size: 10px;
    color: #777;
  }

  .app-container.sub-page-active .site-legal {
    bottom: 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
  }
}

/* ========== 2. Banner 轮播 ========== */
.banner-section {
  padding: 8px 12px 0;
}

.banner-carousel {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 200px;
  box-shadow: var(--shadow-lg);
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
}

.banner-bg {
  position: absolute;
  inset: 0;
}

.banner-bg.bg-1 {
  background: linear-gradient(135deg, #0F4C81 0%, #1a6aad 40%, #4ECDC4 100%);
}

.banner-bg.bg-2 {
  background: linear-gradient(135deg, #0a3d6b 0%, #0F4C81 50%, #FF6B6B 120%);
}

.banner-bg.bg-3 {
  background: linear-gradient(135deg, #0F4C81 0%, #4ECDC4 60%, #0a3d6b 100%);
}

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 1023px) {
  .particle-canvas {
    display: none !important;
  }
}

.banner-content {
  position: relative;
  z-index: 2;
  padding: 28px 24px;
  color: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.banner-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  margin-bottom: 8px;
  width: fit-content;
  letter-spacing: 0.5px;
}

.banner-title {
  font-size: var(--font-title);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.banner-desc {
  font-size: var(--font-body);
  opacity: 0.9;
  margin-bottom: 14px;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  width: fit-content;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.banner-btn:active {
  transform: scale(0.96);
}

.banner-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.banner-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.banner-dots .dot.active {
  width: 18px;
  background: #fff;
}

/* ========== 3. 信任保障 ========== */
.trust-section {
  padding: 16px 12px 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.trust-card {
  padding: 14px 8px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.trust-card:hover,
.trust-card:active {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent-glow), var(--shadow-md);
}

.trust-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
}

.trust-icon svg {
  width: 100%;
  height: 100%;
}

.trust-card h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.trust-card p {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== 4. 核心功能导航 ========== */
.feature-nav-section {
  padding: 16px 12px 0;
}

.home-tools-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-left: 4px;
}

.home-tools-label--services {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 76, 129, 0.06);
}

.feature-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .feature-nav-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========== 一起玩 · 社交大厅 ========== */
.play-together-section {
  padding: 20px 12px 8px;
}
.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.play-together-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.play-game-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.play-filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
}
.play-filter-chip.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.play-post-list { display: flex; flex-direction: column; gap: 10px; }
.play-post-card { padding: 14px 16px; }
.play-post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
}
.play-post-head strong { font-size: 14px; color: var(--text); }
.play-post-game {
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(15, 76, 129, 0.08);
  color: var(--primary);
  font-size: 11px;
}
.play-post-head time { margin-left: auto; color: var(--text-muted); }
.play-post-body { font-size: 14px; line-height: 1.55; margin-bottom: 10px; white-space: pre-wrap; }
.play-empty { text-align: center; padding: 28px 16px; color: var(--text-muted); font-size: 13px; }
.play-empty--error { color: var(--danger, #c0392b); }
.play-post-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.play-post-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

.feature-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  border: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.feature-nav-item:hover,
.feature-nav-item:focus-visible {
  background: rgba(15, 76, 129, 0.06);
  outline: none;
}

.feature-nav-item:active {
  transform: scale(0.97);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(15, 76, 129, 0.07), rgba(78, 205, 196, 0.14));
  color: var(--primary);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.feature-nav-item:hover .feature-icon,
.feature-nav-item:focus-visible .feature-icon {
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 18px rgba(15, 76, 129, 0.22);
  transform: translateY(-1px);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-nav-item span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ========== 5. 估号与回收 ========== */
.service-section {
  padding: 14px 12px 0;
}

.service-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-radius: var(--radius-xl);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  border: none;
  position: relative;
  overflow: hidden;
}

.service-card.glass-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: var(--shadow-sm);
}

.service-card::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 68%);
  pointer-events: none;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.service-card:active {
  transform: scale(0.98);
}

.glow-border::before {
  display: none;
}

.estimate-card {
  background: linear-gradient(135deg, #e8faf8 0%, #f0f7fc 100%);
}

.recycle-card {
  background: linear-gradient(135deg, #fff0f0 0%, #f8f4fc 100%);
}

.service-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.08);
}

.service-card-icon svg {
  width: 100%;
  height: 100%;
}

.refresh-icon {
  animation: spin-slow 4s linear infinite;
  transform-origin: 28px 12px;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.service-card-text {
  flex: 1;
  min-width: 0;
}

.service-card-text h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.service-card-text p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.arrow-icon {
  width: 28px;
  height: 28px;
  padding: 6px;
  color: var(--primary);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.1);
}

/* ========== 6. 分类标签栏 ========== */
.category-section {
  padding: 20px 0 0;
  position: relative;
  overflow: visible;
}

.category-scroll {
  display: block;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 12px;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: contain;
  cursor: grab;
  touch-action: pan-x;
}

.category-scroll.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.category-scroll.is-dragging .category-tab {
  pointer-events: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  position: relative;
  width: fit-content;
  padding-bottom: 2px;
}

.category-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  padding: 8px 12px 10px;
  min-width: 64px;
  font-size: var(--font-body);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.3s ease;
  flex: 0 0 auto;
  white-space: nowrap;
  touch-action: manipulation;
  border: none;
  background: transparent;
  font-family: inherit;
}

.cat-tab-icon,
.cat-tab-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.cat-tab-icon.all {
  background: linear-gradient(135deg, var(--primary), #1565a8);
  color: #fff;
}

.cat-tab-label {
  font-size: 12px;
  line-height: 1.2;
}

.home-filter-bar {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
  flex-wrap: wrap;
}

.home-filter-select {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  background: var(--bg-card);
  color: var(--text-primary);
}

.home-grid-loading {
  grid-column: 1 / -1;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted, #8896a8);
  font-size: 14px;
}

.product-grid .home-grid-loading {
  width: 100%;
}

.product-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 企业级图片：LQIP 模糊占位 + 渐进显示 */
.cover-img-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #eef2f6;
  background-image: var(--cover-blur);
  background-size: cover;
  background-position: center;
  filter: none;
}

.cover-img-shell::before {
  content: '';
  position: absolute;
  inset: -8px;
  background-image: var(--cover-blur);
  background-size: cover;
  background-position: center;
  filter: blur(18px) saturate(1.08);
  transform: scale(1.08);
  opacity: 1;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.cover-img-shell.is-loaded::before {
  opacity: 0;
}

@media (max-width: 1023px) {
  .product-image-wrap .cover-img-fade {
    opacity: 1 !important;
  }

  .product-image-wrap .cover-img-shell::before {
    display: none;
  }

  .product-image-wrap .cover-img-shell {
    background-image: none;
  }
}

.product-image-wrap .product-cover-img.cover-img-fade {
  opacity: 1;
}

.cover-img-fade {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.cover-img-fade.is-loaded {
  opacity: 1;
}

.cover-img-shell--detail::before {
  filter: blur(24px) saturate(1.05);
}

.product-image-wrap .cover-img-shell,
.product-detail-cover .cover-img-shell {
  position: absolute;
  inset: 0;
}

.product-detail-cover .cover-img-shell--detail,
.product-detail-cover .cover-img-shell--detail .product-detail-cover-img {
  width: 100%;
  height: 100%;
}

.cover-img-shell--thumb {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.cover-img-shell--thumb::before {
  filter: blur(12px);
}

.cover-img-shell--thumb .product-gallery-photo,
.cover-img-shell--thumb .product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wm-target.wm-loading {
  opacity: 0.72;
  filter: blur(1px);
}

.wm-target.wm-loading[src] {
  opacity: 1;
  filter: none;
}

.sub-page-body--product-detail .product-detail-cover-img.wm-target:not(.wm-applied),
.sub-page-body--product-detail .product-detail-asset-img.wm-target:not(.wm-applied) {
  opacity: 0;
  visibility: hidden;
}

.sub-page-body--product-detail .product-detail-cover.has-photo .product-detail-cover-img,
.sub-page-body--product-detail .product-detail-cover-img[src]:not(.wm-loading),
.sub-page-body--product-detail .product-detail-asset-img[src]:not(.wm-loading) {
  opacity: 1;
  visibility: visible;
}

.sub-page-body--product-detail .product-detail-cover-img,
.sub-page-body--product-detail .product-detail-asset-img {
  opacity: 1;
  visibility: visible;
}

html.server-watermark .product-cover-img.cover-img-fade,
html.server-watermark .product-detail-cover-img.cover-img-fade {
  opacity: 1;
  visibility: visible;
}

html.server-watermark .sub-page-body--product-detail .product-detail-cover--pending:not(.has-photo)::after,
html.server-watermark .sub-page-body--product-detail .product-detail-asset-item.asset-item--no-src {
  display: none;
}

.sub-page-body--product-detail .product-detail-cover--pending:not(.wm-applied) {
  position: relative;
}

.sub-page-body--product-detail .product-detail-cover--pending:not(.wm-applied)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 100%);
  background-size: 200% 100%;
  animation: product-detail-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
}

.sub-page-body--product-detail .product-detail-asset-item.asset-item--wm-pending {
  min-height: 160px;
  background: linear-gradient(135deg, #e8eef5 0%, #d8e2ec 100%);
}

@media (max-width: 1023px) {
  .sub-page-body--product-detail .product-detail-asset-img {
    opacity: 1;
    visibility: visible;
  }

  .sub-page-body--product-detail .product-detail-cover-img.cover-img-fade,
  .sub-page-body--product-detail .cover-img-shell::before {
    opacity: 1;
  }

  .sub-page-body--product-detail .product-detail-cover .cover-img-shell::before {
    display: none;
  }

  .sub-page-body--product-detail .product-detail-asset-item.asset-item--no-src {
    min-height: 120px;
    background: linear-gradient(135deg, #e8eef5 0%, #d8e2ec 100%);
  }
}

@keyframes product-detail-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.wm-target.wm-applied {
  user-select: none;
  -webkit-user-drag: none;
}

.product-gallery-img {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #0e0e0e;
  overflow: hidden;
}

.product-gallery-photo {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.product-gallery-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#imageLightboxImg.wm-loading {
  opacity: 0.7;
}

#imageLightboxImg.wm-applied {
  user-select: none;
}

.banner-bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.banner-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.sell-equipment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sell-filter-group + .sell-filter-group {
  margin-top: 14px;
}

.sell-filter-group-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.sell-filter-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sell-equip-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 18px;
  border: 1px solid rgba(15, 76, 129, 0.15);
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
}

.sell-equip-tag input {
  display: none;
}

.sell-equip-tag.is-on {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
}

.sell-field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.sell-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sell-upload-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 76, 129, 0.06);
  border: 1px dashed rgba(15, 76, 129, 0.2);
}

.sell-upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sell-upload-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
}

.sell-upload-add span {
  font-size: 28px;
  line-height: 1;
  color: var(--primary);
}

.sell-upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.category-tab.active {
  color: var(--primary);
  font-weight: 600;
}

.category-tab.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  box-shadow: 0 0 8px var(--accent-glow);
  animation: underline-glow 2s ease-in-out infinite;
}

@keyframes underline-glow {
  0%, 100% { box-shadow: 0 0 6px var(--accent-glow); }
  50% { box-shadow: 0 0 14px var(--accent-glow), 0 0 4px var(--accent); }
}

/* ========== 7. 商品列表 ========== */
.products-section {
  padding: 16px 12px 0;
}

.product-block {
  margin-bottom: 24px;
}

@media (max-width: 1023px) {
  .trust-section,
  .feature-nav-section,
  .service-section,
  .category-section,
  .product-block {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .product-block {
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  .product-card.page-transition {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-subtitle);
  font-weight: 700;
  color: var(--text-primary);
}

.title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.title-icon.price-drop {
  background: var(--highlight-soft);
  color: var(--highlight);
}

.title-icon.new-arrival {
  background: rgba(78, 205, 196, 0.15);
  color: var(--accent);
}

.view-more {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 0;
}

@media (max-width: 1023px) {
  .block-header {
    align-items: center;
  }
  .view-more {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.08);
  }
  .view-more:active {
    background: rgba(15, 76, 129, 0.14);
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  contain: content;
}

@media (hover: hover) and (pointer: fine) {
  .product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }

  .product-card:hover .product-image-wrap img,
  .product-card:hover .product-image-wrap .product-placeholder,
  .product-card:hover .product-image-wrap .cover-img-shell {
    transform: rotateY(-3deg) rotateX(2deg) scale(1.03);
  }
}

.product-card:active {
  opacity: 0.94;
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #e8eef4, #dce6f0);
}

@media (hover: hover) and (pointer: fine) {
  .product-image-wrap {
    perspective: 600px;
  }
}

.product-image-wrap > img,
.product-image-wrap > .product-placeholder,
.product-image-wrap > .cover-img-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) and (pointer: fine) {
  .product-image-wrap > img,
  .product-image-wrap > .product-placeholder,
  .product-image-wrap > .cover-img-shell {
    transition: transform 0.4s ease;
  }
}

.product-image-wrap img,
.product-image-wrap .product-placeholder {
  object-fit: cover;
}

@media (max-width: 1023px) {
  .main-content {
    -webkit-overflow-scrolling: touch;
  }

  .product-grid {
    touch-action: pan-y;
  }

  .top-nav.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.97);
  }

  .bottom-nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.98);
  }

  .bottom-icon {
    transition: none;
  }

  .product-card,
  .bottom-nav-item,
  .category-tab {
    touch-action: manipulation;
  }

  .product-card:active {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .cover-img-fade {
    transition: none;
  }
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--highlight), #ff8585);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
  z-index: 2;
}

.product-info {
  padding: 10px;
}

.product-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 36px;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--highlight);
  margin-bottom: 4px;
}

.product-price .currency {
  font-size: 12px;
  font-weight: 600;
}

.product-id {
  font-size: 11px;
  color: var(--text-muted);
}

/* 商品占位图样式 */
.product-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F4C81 0%, #4ECDC4 100%);
}

.game-icon {
  width: 48px;
  height: 48px;
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

/* 通用 UI 图标 */
.ui-icon {
  display: block;
  flex-shrink: 0;
}

.title-icon .title-svg {
  width: 14px;
  height: 14px;
}

.title-icon.price-drop .title-svg {
  color: var(--highlight);
}

.title-icon.new-arrival .title-svg {
  color: var(--accent);
}

/* ========== 8. 底部导航栏 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--bottom-nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(15, 76, 129, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  pointer-events: auto;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-item.active .bottom-icon {
  animation: bounce-icon 0.5s ease;
}

.bottom-nav-item.active .bottom-icon svg {
  stroke: url(#bottomGrad);
}

.bottom-nav-item.active .bottom-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.bottom-nav-item.active svg {
  stroke: var(--primary);
  fill: none;
}

/* 渐变填充效果 */
.bottom-nav-item.active .bottom-icon svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.bottom-nav-item span {
  font-size: 10px;
  font-weight: 500;
}

@keyframes bounce-icon {
  0% { transform: scale(1); }
  40% { transform: scale(1.25) translateY(-3px); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ========== H5 布局（必须在 styles.css，不可只放在 pc.css） ========== */
@media (max-width: 1023px) {
  .pc-header-top,
  .pc-sub-nav,
  .pc-game-strip,
  .pc-market-head,
  .desktop-login-btn,
  .pc-footer-logo,
  .pc-footer-slogan,
  .pc-footer-badges,
  .pc-footer-links,
  .pc-notice-panel,
  .pc-trust-bar {
    display: none !important;
  }

  .pc-footer-top {
    display: block !important;
    padding: 0 !important;
    border: none !important;
  }

  .pc-footer {
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .pc-footer-inner {
    max-width: none;
    padding: 0;
  }

  .mobile-header {
    display: flex !important;
  }

  .pc-home-top {
    display: block !important;
    margin-bottom: 0;
  }

  .pc-hero-band,
  .pc-banner-row,
  .pc-market-wrap,
  .mobile-home-sections {
    display: contents;
  }

  .mine-pc-actions {
    display: none !important;
  }

  .banner-section {
    display: block;
    width: 100%;
  }

  .banner-carousel {
    display: block;
    width: 100%;
    height: 200px;
  }

  .tab-page-header-main,
  .tab-page-header-desc {
    display: none !important;
  }

  .sub-page .tab-page-header--subpage .tab-page-header-main {
    display: block !important;
  }

  .tab-page-header {
    min-height: 44px;
    padding: 0 4px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .tab-page-header--sub {
    min-height: 44px;
    padding: 0 4px;
    align-items: center;
  }

  .product-game-tag,
  .product-meta-tags {
    display: none;
  }

  .product-info-foot {
    display: contents;
  }
}

@media (min-width: 431px) {
  body {
    background: linear-gradient(180deg, #dce6f0 0%, var(--bg-page) 120px);
  }

  .app-container {
    box-shadow: 0 0 40px rgba(15, 76, 129, 0.1);
  }
}

/* ========== 错误态 / 图片加载失败 ========== */
.img-broken {
  object-fit: contain !important;
  background: #f5f7fa;
  border: 1px dashed #e74c3c;
}
.img-broken-bg {
  position: relative;
}
.img-broken-bg .img-broken-label {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(231, 76, 60, 0.92);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
  white-space: nowrap;
}
.toast.toast-error {
  background: rgba(192, 57, 43, 0.94) !important;
}
.toast.toast-success {
  background: rgba(39, 174, 96, 0.94) !important;
}
