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

body {
  font-family: -apple-system, BlinkMacSystemFont,  Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
  padding-bottom: 70px;
}

/* 头部导航 */
.header {
  background: linear-gradient(135deg, #ff6b6b, #ffa94d);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-item {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s;
}

.nav-item.active {
  background: rgba(255,255,255,0.2);
  color: white;
  font-weight: 600;
}

/* 页面切换 */
.page {
  display: none;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.page.active {
  display: block;
}

/* 搜索框 */
.search-box {
  margin-bottom: 16px;
}

.search-input-wrap {
  display: flex;
  gap: 8px;
  background: white;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 16px;
  background: transparent;
  border-radius: 10px;
}

.search-input-wrap button {
  background: linear-gradient(135deg, #ff6b6b, #ffa94d);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.search-input-wrap button:active {
  transform: scale(0.95);
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px 0;
  color: #999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 搜索结果 */
.search-result {
  min-height: 200px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-sub {
  font-size: 13px;
  color: #bbb;
  margin-top: 4px;
}

/* 平台商品卡片 */
.platform-section {
  margin-bottom: 20px;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}

.platform-header .tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  color: white;
  font-weight: 500;
}

.tag-taobao { background: #ff6a00; }
.tag-jd { background: #e4393c; }
.tag-pdd { background: #e02e24; }

.product-card {
  background: white;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.product-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f9f9f9;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-title {
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  line-height: 1.4;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: #ff4757;
}

.product-price .symbol {
  font-size: 12px;
}

.product-original-price {
  font-size: 12px;
  color: #bbb;
  text-decoration: line-through;
}

.product-sales {
  font-size: 12px;
  color: #999;
}

.product-coupon {
  background: #ff4757;
  color: white;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

.buy-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: linear-gradient(135deg, #ff6b6b, #ffa94d);
  color: white;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}

.buy-btn:active {
  transform: scale(0.95);
}

/* 比价汇总 */
.compare-bar {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.compare-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #666;
}

.compare-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.compare-item:last-child {
  border-bottom: none;
}

.compare-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.compare-price {
  font-size: 16px;
  font-weight: 700;
  color: #ff4757;
}

.compare-best {
  background: #ff6b6b;
  color: white;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* ===== 好物推荐 - 四宫格 ===== */
.recommend-header {
  text-align: center;
  padding: 20px 0;
}

.recommend-header h2 {
  font-size: 22px;
  margin-bottom: 4px;
}

.recommend-sub {
  font-size: 13px;
  color: #999;
}

/* 四宫格容器 */
.recommend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 0 16px 0;
}

.recommend-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.recommend-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

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

.recommend-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.recommend-content {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.recommend-price {
  font-size: 18px;
  font-weight: 700;
  color: #ff4757;
  margin-bottom: 8px;
}

.recommend-price .symbol {
  font-size: 13px;
}

.recommend-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.recommend-link {
  flex: 1;
  min-width: 60px;
  text-align: center;
  padding: 6px 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-decoration: none;
}

.link-taobao { background: #ff6a00; }
.link-jd { background: #e4393c; }
.link-pdd { background: #e02e24; }

/* 底部 */
.footer {
  text-align: center;
  padding: 20px;
  color: #bbb;
  font-size: 12px;
}

/* 提示信息 */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  display: none;
}

/* ===== 热唀版品动换 ===== */
.trending-section {
  margin: 0 0 20px 0;
}
.trending-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
}
.trending-header .hot {
  background: #ff4757;
  color: white;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  animation: pulse 2s ease-in-out infinite;
}
@-webkit-keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.trending-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trending-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  gap: 10px;
  padding: 10px;
}

.trending-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f9f9f9;
}

.trending-info {
  flex: 1;
  min-width: 0;
}

.trending-info .title {
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 6px;
}

.trending-info .price {
  font-size: 18px;
  font-weight: 700;
  color: #ff4757;
}

.trending-info .tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 12px;
  color: white;
  margin-right: 4px;
}

.tag-hot { background: #ff4757; }
.tag-popular { background: #ff9b43; }
.tag-new { background: #2b2cff; }
.tag-hot_sale { background: #07a487; }

.trending-info .buy-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  background: linear-gradient(135deg, #ff6b6b, #ffa94d);
  color: white;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}