/* ============================================
   聚惠商城 · 前台玻璃拟态统一样式
   在 assets/style.css 之后引入，仅作用于前台页面
   后台 admin/* 不引入本文件，互不影响
   ============================================ */
* { -webkit-tap-highlight-color: transparent; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(59, 130, 246, 0.25), transparent 26%),
    radial-gradient(circle at 80% 0%, rgba(139, 92, 246, 0.18), transparent 28%),
    linear-gradient(180deg, #eef3ff 0%, #f6f8fc 40%, #f1f4fa 100%);
  color: #1f2937;
  padding-bottom: 96px;
}
a { color: #2563eb; }
a:hover { color: #1d4ed8; }

/* ---------- 顶部导航栏（毛玻璃，全宽铺满） ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  border-radius: 0 0 24px 24px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: none;
  box-shadow:
    0 10px 30px rgba(59, 130, 246, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.container.header-inner {
  height: auto;
  gap: 12px;
  padding: 26px 16px 26px;
  max-width: none;
}
.logo {
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.logo span {
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
  background: none;
  -webkit-text-fill-color: #2563eb;
}
/* 搜索表单：靠右显示，不占满中间 */
.search-form { margin-left: auto; flex: 0 1 auto; width: 58%; max-width: 420px; display: flex; min-width: 0; }

/* 顶部收藏/分享图标（非首页） */
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-actions .h-act { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #2563eb; background: rgba(255,255,255,.72); box-shadow: 0 4px 10px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.9); }
.header-actions .h-act:active { transform: scale(.94); }
.search-box {
  flex: 1;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: #374151;
  font-family: inherit;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.06),
    0 4px 14px rgba(37, 99, 235, 0.12);
}
/* 前台不再显示导航按钮与侧边菜单 */
.nav { display: none; }

/* ---------- 容器 ---------- */
.container { max-width: 1200px; padding: 0 16px; }

/* ---------- 卡片（毛玻璃） ---------- */
.card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-radius: 22px;
  border: none;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow:
    0 18px 40px rgba(59, 130, 246, 0.16),
    0 6px 14px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.card-title {
  border-bottom: 1px dashed rgba(37, 99, 235, 0.18);
  color: #111827;
}

/* ---------- 按钮 ---------- */
.btn { border-radius: 14px; }
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.35),
    0 4px 10px rgba(37, 99, 235, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(37, 99, 235, 0.45); color: #fff; }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.32), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-success:hover { box-shadow: 0 14px 28px rgba(16,185,129,.45); color: #fff; }
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 12px 24px rgba(239,68,68,.32), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-danger:hover { box-shadow: 0 14px 28px rgba(239,68,68,.45); color: #fff; }
.btn-default {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: #374151;
}
.btn-default:hover { background: rgba(255,255,255,0.95); color: #2563eb; }

/* ---------- 表单（毛玻璃） ---------- */
.form-control {
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(37, 99, 235, 0.14);
  border-radius: 14px;
  color: #1f2937;
  font-family: inherit;
}
.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
  background: #fff;
}

/* ---------- 分类导航（前台按钮式 → 玻璃胶囊） ---------- */
.category-bar .btn {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
}
.category-bar .btn-primary { color: #fff; }

/* ---------- 商品网格 / 卡片 ---------- */
.goods-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
.goods-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-radius: 22px;
  border: none;
  box-shadow:
    0 20px 45px rgba(59, 130, 246, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.goods-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 30px 60px rgba(59, 130, 246, 0.32),
    0 16px 30px rgba(0, 0, 0, 0.12);
}
.goods-card:active { transform: translateY(-6px) scale(1.01); }
.goods-img {
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.9), rgba(203, 213, 225, 0.75));
  aspect-ratio: 1 / 1;
  height: auto;
}
.goods-img img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  padding: 0;
}
.goods-name { color: #1f2937; font-weight: 600; }
.goods-price { color: #ef4444; }
.goods-price-row .goods-sales {
  background: rgba(255, 241, 230, 0.8);
  color: #ea580c;
}

/* ---------- 商品详情 ---------- */
.goods-detail { grid-template-columns: 1fr 1fr; gap: 26px; }
.goods-detail-img {
  background: linear-gradient(180deg, rgba(226,232,240,.9), rgba(203,213,225,.75));
  border-radius: 22px;
}
.goods-detail-info h1 { color: #111827; }
.goods-detail-price {
  background: rgba(255, 242, 242, 0.7);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}
.goods-detail-price .price { color: #ef4444; }
.goods-detail-desc { background: rgba(255,255,255,.6); border-radius: 14px; }

/* ---------- 合计框 ---------- */
.total-box {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.3);
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table th { background: rgba(241, 245, 249, 0.8); }
.table th, .table td { border-bottom: 1px solid rgba(37, 99, 235, 0.1); }
.table tr:hover { background: rgba(238, 243, 255, 0.6); }

/* ---------- 消息 ---------- */
.msg { border-radius: 14px; }

/* ---------- 数量选择 ---------- */
.quantity-box input { background: #fff; border-radius: 12px; }

/* ---------- 页脚（前台简化） ---------- */
.footer {
  background: transparent;
  border-top: none;
  color: #8a8f99;
}

/* ---------- 底部 Tab（毛玻璃） ---------- */
.footer-tab {
  position: fixed;
  bottom: 14px;
  left: 12px;
  right: 12px;
  z-index: 99;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 24px;
  padding: 8px 0;
  display: flex;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 16px 35px rgba(59, 130, 246, 0.2),
    0 6px 14px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.tab-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.tab-item i { font-size: 18px; }
.tab-item.active { color: #2563eb; font-weight: 700; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; }

/* ---------- 支付 / 充值 / 成功页（玻璃化） ---------- */
.pay-wrap, .success-page {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-radius: 24px;
  box-shadow:
    0 20px 45px rgba(59, 130, 246, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.pay-header { background: transparent; border-bottom: 1px solid rgba(37, 99, 235, 0.12); }
.order-info, .order-card, .qr-section {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12), inset 0 1px 0 rgba(255,255,255,.9);
}
.pay-done-btn { border-radius: 14px; }
.success-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 14px 30px rgba(16, 185, 129, 0.35);
}
.btn-group .btn { border-radius: 14px; }

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .goods-grid { grid-template-columns: repeat(3, 1fr); }
  .goods-detail { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .goods-detail { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 16px; border-radius: 18px; }
}
