/* 鲸禧商城 - 公共样式 */

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #f5f5f5;
  -webkit-font-smoothing: antialiased;
}

/* 移动端适配 */
html {
  font-size: 13.3333vw; /* 1rem = 100px at 750px width */
}

@media screen and (min-width: 750px) {
  html {
    font-size: 100px;
  }
}

/* 页面容器 */
.page {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
}

.page-white {
  background-color: #fff;
}

/* 导航栏 */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0.88rem;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* 透明导航栏：默认用项目主题色 #2563eb 与 banner 同色不透明，
   内容滚动时被 nav-bar 物理遮挡（无穿透）。
   banner 颜色不是主题色的页面在自己的 <style> 里 override .nav-bar 即可。 */
.nav-bar.transparent {
  background-color: #2563eb;
  box-shadow: none;
}

.nav-bar-title {
  font-size: 0.34rem;
  font-weight: 500;
  color: #333;
}

.nav-bar.transparent .nav-bar-title {
  color: #fff;
}

/* 返回按钮：无背景，纯灰色 SVG 箭头；隐藏任何 HTML 里残留的 ‹/< 字符 */
.nav-bar-back {
  position: absolute;
  left: 0.2rem;
  width: 0.7rem;
  height: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0 !important;          /* 把 HTML 里残留的 ‹ 文字字符 隐藏 */
  color: transparent !important;     /* 双保险 */
  background: transparent;
  border: none;
  -webkit-tap-highlight-color: transparent;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath fill='%23707070' d='M773.5 143.3L403 514.6l370.5 371.2-76.2 76.3-446.6-447.5L697.3 67l76.2 76.3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.34rem 0.34rem;
  transition: opacity 0.2s ease;
}
.nav-bar-back:active { opacity: 0.6; }
.nav-bar-back::before { content: none; }   /* 取消之前 ::before 的箭头，避免重叠 */

/* 透明导航栏（覆盖在彩色 banner 上）— 改用白色箭头 */
.nav-bar.transparent .nav-bar-back {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath fill='%23ffffff' d='M773.5 143.3L403 514.6l370.5 371.2-76.2 76.3-446.6-447.5L697.3 67l76.2 76.3z'/%3E%3C/svg%3E");
}

/* 右侧按钮 */
.nav-bar-right {
  position: absolute;
  right: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* Flex布局 */
.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-center {
  align-items: center;
  justify-content: center;
}

.flex-between {
  justify-content: space-between;
}

.flex-around {
  justify-content: space-around;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.align-center {
  align-items: center;
}

/* 间距 */
.mt-10 { margin-top: 0.2rem; }
.mt-20 { margin-top: 0.4rem; }
.mt-30 { margin-top: 0.6rem; }
.mb-10 { margin-bottom: 0.2rem; }
.mb-20 { margin-bottom: 0.4rem; }
.ml-10 { margin-left: 0.2rem; }
.mr-10 { margin-right: 0.2rem; }
.p-20 { padding: 0.4rem; }
.p-30 { padding: 0.6rem; }

/* 文字 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-white { color: #fff; }
.text-gray { color: #999; }
.text-primary { color: #2563eb; }
.text-bold { font-weight: bold; }

.font-12 { font-size: 0.24rem; }
.font-13 { font-size: 0.26rem; }
.font-14 { font-size: 0.28rem; }
.font-15 { font-size: 0.3rem; }
.font-16 { font-size: 0.32rem; }
.font-17 { font-size: 0.34rem; }
.font-18 { font-size: 0.36rem; }
.font-20 { font-size: 0.4rem; }
.font-24 { font-size: 0.48rem; }

/* 卡片 */
.card {
  background-color: #fff;
  border-radius: 0.16rem;
  margin: 0.2rem 0.3rem;
  padding: 0.3rem;
  box-shadow: 0 0.02rem 0.1rem rgba(0,0,0,0.05);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
  height: 0.8rem;
  border-radius: 0.4rem;
  font-size: 0.28rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-large {
  height: 0.96rem;
  font-size: 0.32rem;
}

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  padding: 0.3rem;
  background-color: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.list-item:last-child {
  border-bottom: none;
}
.list-item { transition: background 0.15s ease; }
.list-item:active { background: #f5f5f5; }

/* 通用 tap 反馈:卡片/商品/分类入口 */
.card-item, .product-card, .feature-item, .home-promo-card,
.coupon-item, .order-tab-item, .stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-item:active, .product-card:active, .feature-item:active,
.home-promo-card:active, .coupon-item:active, .order-tab-item:active,
.stat-card:active {
  transform: scale(0.97);
}

/* 入场淡入 */
@keyframes platformFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: platformFadeUp 0.32s ease both; }

/* Toast 平滑出现/消失(若存在) */
.toast, .custom-toast {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.list-item-content {
  flex: 1;
}

.list-item-arrow {
  width: 0.3rem;
  height: 0.3rem;
  opacity: 0.5;
}

/* 图片 */
img {
  max-width: 100%;
  display: block;
}

/* 输入框 */
.input {
  width: 100%;
  height: 0.8rem;
  padding: 0 0.3rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.08rem;
  font-size: 0.28rem;
  outline: none;
}

.input:focus {
  border-color: #2563eb;
}

/* 底部TabBar */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(1rem + env(safe-area-inset-bottom));
  background-color: #fff;
  display: flex;
  border-top: 1px solid #e5e5e5;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 500;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  border: none !important;
  -webkit-tap-highlight-color: transparent;
  color: #999;
  font-size: 0.2rem;
}

.tab-item.active {
  color: #2563eb;
}

/* 底栏图标：用 SVG mask + currentColor，激活态只变颜色不变尺寸 */
.tab-icon {
  width: 0.48rem;
  height: 0.48rem;
  margin-bottom: 0.06rem;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.tab-icon-home {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3.172 3 11v10h6v-6h6v6h6V11z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3.172 3 11v10h6v-6h6v6h6V11z'/%3E%3C/svg%3E");
}
.tab-icon-finance {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M21 8V6c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2h-9c-1.11 0-2-.9-2-2v-4c0-1.1.89-2 2-2zm-9 2h10v4h-10z'/%3E%3Ccircle fill='%23000' cx='15.5' cy='12' r='1.2'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M21 8V6c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2h-9c-1.11 0-2-.9-2-2v-4c0-1.1.89-2 2-2zm-9 2h10v4h-10z'/%3E%3Ccircle fill='%23000' cx='15.5' cy='12' r='1.2'/%3E%3C/svg%3E");
}
.tab-icon-cart {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM7.17 14.75 8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L20.88 5H6.21l-.94-2H2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M7 18c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM7.17 14.75 8.1 13h7.45c.75 0 1.41-.41 1.75-1.03L20.88 5H6.21l-.94-2H2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25z'/%3E%3C/svg%3E");
}
.tab-icon-my {
  -webkit-mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
}

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.empty-img {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.3rem;
}

.empty-text {
  color: #999;
  font-size: 0.28rem;
}

/* 加载中 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  color: #999;
}

/* 遮罩层 */
.mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 200;
}

/* 弹窗 */
.popup {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  border-radius: 0.24rem 0.24rem 0 0;
  z-index: 201;
  padding-bottom: env(safe-area-inset-bottom);
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem;
  border-bottom: 1px solid #f0f0f0;
}

.popup-title {
  font-size: 0.32rem;
  font-weight: 500;
}

.popup-close {
  font-size: 0.4rem;
  color: #999;
}

/* 网格布局 */
.grid {
  display: flex;
  flex-wrap: wrap;
}

.grid-item {
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.3rem 0;
}

.grid-item-icon {
  width: 0.88rem;
  height: 0.88rem;
  margin-bottom: 0.16rem;
}

.grid-item-text {
  font-size: 0.24rem;
  color: #666;
}

/* 徽章 */
.badge {
  position: absolute;
  top: -0.1rem;
  right: -0.1rem;
  min-width: 0.32rem;
  height: 0.32rem;
  padding: 0 0.08rem;
  background-color: #ff4d4f;
  color: #fff;
  font-size: 0.2rem;
  border-radius: 0.16rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 分割线 */
.divider {
  height: 0.2rem;
  background-color: #f5f5f5;
}

/* 价格 */
.price {
  color: #2563eb;
  font-weight: bold;
}

.price-symbol {
  font-size: 0.24rem;
}

.price-integer {
  font-size: 0.36rem;
}

.price-decimal {
  font-size: 0.24rem;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.04rem 0.12rem;
  font-size: 0.2rem;
  border-radius: 0.04rem;
}

.tag-primary {
  background-color: #eff6ff;
  color: #2563eb;
}

.tag-success {
  background-color: #f0fff4;
  color: #52c41a;
}

/* 隐藏滚动条 */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 安全区域 */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-top {
  padding-top: env(safe-area-inset-top);
}
