* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
}
a {
  text-decoration: none;
  cursor: pointer;
}

/* 页面容器 */
.page-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #fff;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}
/* 分类按钮区域 */
.category-buttons {
  padding: 15px 0;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px 0;
}
.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 5px;
  cursor: pointer;
}
.category-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: #3c9eff;
  transition: transform 0.3s;
}
.all-icon {
  border-radius: 30px;
  border: 1px solid #3c9eff;
}
.category-icon img {
  width: 100%;
  height: 100%;
  border-radius: 30px;
}
.category-btn:hover .category-icon {
  transform: scale(1.1);
}
.category-name {
  font-size: 12px;
  color: #333;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 15px 0 15px;
}
.section-title h3 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}
.section-title h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background-color: #ff6a3c;
  margin-right: 8px;
  vertical-align: middle;
}
/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #1e90ff, #4da6ff);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 8px 0;
  flex: 1;
  transition: all 0.3s ease;
}

.nav-item.active {
  color: #fff;
}

.nav-icon {
  font-size: 24px;
}

.nav-text {
  font-size: 12px;
  font-weight: 500;
}

.nav-item.active .nav-icon {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 主内容区域 */
.main-content {
  padding-bottom: 70px;
  min-height: 100vh;
}

/* 页面样式 */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 头部样式 */
.page-header {
  background: linear-gradient(135deg, #1e90ff, #4da6ff);
  color: white;
  padding: 10px 0;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}

.page-subtitle {
  font-size: 14px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}
/*幻灯*/
.swiper-slide img {
    width: 100%;
}


/* 返回按钮 */
.back-button {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  text-decoration: none;
  z-index: 1;
}

/* 产品卡片 */
.product-container {
  background: white; 
  border-radius: 12px; 
  margin: 16px; 
  overflow: hidden; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-image {
  height: 140px;
  background: linear-gradient(135deg, #e6f2ff, #cce5ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  position: relative;
}
.product-image img {
  height: 100%;
  width: 100%;
}
.product-detail{
  padding: 5px 0;
  margin: 0 10px;
  border-bottom: 1px solid #b7b7b7;
}
.product-detail h2{
  font-size: 20px; 
  font-weight: 600; 
  text-align: center;
}
.product-price{
  color: #ff4444; 
  font-size: 24px; 
  font-weight: bold; 
  margin-bottom: 10px;
}
.product-num{
  padding: 2px 12px;
  text-align: right;
}
.product-content{
  color: #666;
  line-height: 1.6;
  padding: 10px 20px;
}
.product-content img{
  width: 100%;
}
.product-stock {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.product-desc {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  line-height: 1.4;
  height: 34px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-footer {
  text-align: center;
}

.product-price {
  color: #ff4444;
  font-size: 18px;
  font-weight: bold;
}
/*激活码激活*/
.code-container{
  background: white;
  border-radius: 12px;
  margin: 16px;
  padding: 0 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.code-container h3{
  font-size: 18px; 
  font-weight: 600; 
  margin-bottom: 16px;
}
.code-input{
  margin-bottom: 16px;
}
.code-result{
  margin-top: 16px; 
  display: none; 
  padding: 12px; 
  border-radius: 8px; 
  text-align: center;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #1e90ff, #4da6ff);
  color: white;
}

.btn-primary:active {
  background: linear-gradient(135deg, #0d7ae6, #3d96f0);
  transform: scale(0.98);
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

/* 表单样式 */
.form-container {
  padding: 20px 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: #1e90ff;
  outline: none;
}

/* 用户中心样式 */
.user-profile {
  display: flex;
  align-items: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, #1e90ff, #4da6ff);
  color: white;
}

.user-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-right: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-info h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.user-info p {
  opacity: 0.9;
  font-size: 14px;
}

.menu-list {
  padding: 16px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-item:active {
  background: #f8f9fa;
  transform: translateX(4px);
}

.menu-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #e6f2ff, #cce5ff);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #1e90ff;
  margin-right: 16px;
}

.menu-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.menu-arrow {
  color: #999;
  font-size: 14px;
}

/* 地址卡片 */
.address-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #1e90ff;
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.address-name {
  font-weight: 600;
  font-size: 16px;
}

.address-phone {
  color: #666;
}

.default-tag {
  background: #1e90ff;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.address-detail {
  color: #666;
  margin-bottom: 12px;
  line-height: 1.4;
}

.address-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.action-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
}

.edit-btn {
  background: #e6f2ff;
  color: #1e90ff;
}

.delete-btn {
  background: #ffe6e6;
  color: #ff4444;
}

/* 激活码卡片 */
.code-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #1e90ff;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.code-product {
  font-weight: 600;
  font-size: 16px;
}

.code-status {
  background: #e6f2ff;
  color: #1e90ff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.code-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin: 12px 0;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  letter-spacing: 1px;
}

.code-info {
  color: #666;
  font-size: 13px;
}

.code-info div {
  margin-bottom: 4px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-text {
  font-size: 16px;
  margin-bottom: 20px;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  gap: 12px;
}

/* 响应式 */
@media (max-width: 360px) {
  .product-grid {
      grid-template-columns: 1fr;
  }
}

/* 工具类 */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 20px; }
.mt-2 { margin-top: 20px; }
.p-2 { padding: 20px; }