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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  background-color: #fff;
  min-height: 100vh;
  position: relative;
  padding-bottom: 70px;
}

/* 头部 */
.header {
  background: url('banner.svg') no-repeat center center;
  background-size: cover;
  color: white;
  padding: 15px;
  position: relative;
  min-height: 180px;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(10, 5, 2, 0.3) 0%, rgba(10, 5, 2, 0.1) 60%, rgba(10, 5, 2, 0.8) 100%);
  z-index: 0;
}

.header > * {
  position: relative;
  z-index: 1;
}

.header-content {
  display: inline-block;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
  background: linear-gradient(135deg, #f5d878 0%, #ffe8a0 50%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.subtitle {
  font-size: 13px;
  color: #d4a017;
  opacity: 1;
  margin-top: 2px;
  letter-spacing: 2px;
}

.user-area {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-btn {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(139, 105, 20, 0.5);
  border: 1px solid rgba(212, 160, 23, 0.6);
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}

.user-btn:hover {
  background: rgba(212, 160, 23, 0.7);
  border-color: rgba(245, 216, 120, 0.8);
}

.cart-btn {
  background: rgba(212, 160, 23, 0.6);
  border-color: rgba(245, 216, 120, 0.7);
}

.user-welcome {
  color: #f5d878;
  font-size: 13px;
}

/* 分类切换按钮 */
.category-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(139, 105, 20, 0.5);
  border: 1px solid rgba(212, 160, 23, 0.6);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}

.category-toggle-btn:hover {
  background: rgba(212, 160, 23, 0.7);
  border-color: rgba(245, 216, 120, 0.8);
}

.toggle-icon {
  font-size: 14px;
}

.toggle-text {
  font-size: 13px;
}

/* 主内容区 */
.main-content {
  padding: 0;
}

/* 商品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
}

/* 商品卡片 */
.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: #f9f9f9;
}

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

.placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
  background: #f9f9f9;
}

.stock-tag {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.sold-out {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 16px;
  font-weight: bold;
  padding: 5px 15px;
  border-radius: 6px;
}

.badge-top {
  position: absolute;
  top: 5px;
  left: 5px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-new {
  position: absolute;
  top: 5px;
  left: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-limit {
  position: absolute;
  top: 5px;
  left: 75px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-info {
  padding: 10px;
  cursor: pointer;
}

.product-name {
  font-size: 14px;
  color: #333;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.product-price {
  font-size: 18px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 3px;
}

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

.add-to-cart-btn {
  width: 100%;
  padding: 7px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.3s;
}

.add-to-cart-btn:hover {
  background: #5a6fd6;
}

.add-to-cart-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 浮动客服按钮 */
.floating-button {
  position: fixed;
  bottom: 80px;
  right: 15px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #667eea;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
  z-index: 100;
  transition: transform 0.2s;
}

.floating-button:hover {
  transform: scale(1.1);
}

.floating-button .icon {
  font-size: 20px;
  line-height: 1;
}

.floating-button .label {
  font-size: 9px;
  margin-top: 1px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  display: flex;
  border-top: 1px solid #eee;
  padding: 8px 0;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: #999;
  position: relative;
}

.nav-item.active {
  color: #667eea;
}

.nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.nav-text {
  font-size: 12px;
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 25%;
  background: #e74c3c;
  color: white;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* 弹窗通用样式 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.close-modal:hover {
  color: #333;
}

/* 二维码弹窗 */
.qrcode-container {
  text-align: center;
  padding: 10px;
}

.qrcode-container h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
}

.qrcode-image {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
}

.qrcode-container p {
  font-size: 14px;
  color: #666;
}

/* 欢迎弹窗 */
.welcome-modal {
  text-align: center;
}

.welcome-container h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 10px;
}

.welcome-container p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  white-space: pre-line;
}

/* 分类弹窗 */
.category-modal {
  max-width: 350px;
}

.category-container h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #f8f9fa;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

.category-item:hover {
  background: #e8eaf6;
}

.category-icon {
  font-size: 24px;
}

.category-name {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd6;
}
