/* ============================================================
   纳嘉科技报价系统 - 纯手机端样式
   所有选择器以 m- 前缀，完全独立于 PC 版
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #ffffff; font-size: 14px; color: #333; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ========== 顶部固顶区域 ========== */
.m-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ========== 搜索框（固顶区域内）========== */
.m-search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 6px 10px;
  margin: 6px 10px;
}

/* ========== 2026-06-06 11:10 外观美化 · 蓝色线圈 + 同样高度 ========== */
/* 共用圈样式：高度 30px、蓝色线、透明背景 */
.m-bordered {
  background: rgba(255,255,255,0.95) !important;
  border: 1.5px solid #1890ff !important;
  height: 30px !important;
  box-sizing: border-box;
}
.m-circle {
  border-radius: 16px !important;
}
/* 搜索框变圈线（重置原背景） */
.m-search-row .m-search-box.m-bordered {
  background: transparent !important;
  border: 1.5px solid #1890ff !important;
}
.m-search-row .m-search-box.m-bordered input { background: transparent; padding: 2px 0; }
.m-search-row .m-search-box.m-bordered button { padding: 0 2px; }
/* + 按钮：圈 + 蓝边 + 严格居中 */
.m-more-btn {
  flex: 0 0 30px !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  cursor: pointer !important;
  font-size: 18px !important;
  line-height: 1 !important;
  color: #1890ff !important;
  font-weight: bold !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  background: #fff !important;
  border: 1.5px solid #1890ff !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  position: relative !important;  /* 2026-06-06 12:30 让子菜单 mMoreMenu 绝对定位 */
}
/* 焦点变整行：focus-within 父级 .m-search-row 起作用，搜索框 flex 变 1，快捷导航 + + 隐藏 */
.m-search-row:focus-within #mQuickNavBar,
.m-search-row:focus-within .m-more-btn {
  display: none !important;
}
.m-search-row:focus-within .m-search-box {
  flex: 1 1 100% !important;
}
/* focus 整行时放大镜移到右：flex-direction row-reverse */
.m-search-row:focus-within .m-search-box {
  flex-direction: row !important;  /* 保持 row，但用 order 调整 */
}
.m-search-row:focus-within .m-search-icon {
  order: 99 !important;  /* 放大镜放到 input 后面 = 右边 */
}

.m-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  padding: 4px;
  outline: none;
  color: #333;
}

.m-search-box button {
  border: none;
  background: transparent;
  font-size: 16px;
  padding: 2px 4px;
}

/* ========== 筛选行（品牌/价格）========== */
.m-filter-row {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 5px 10px;
  min-height: 32px;
  line-height: 1.5;
}

.m-filter-label {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-weight: bold;
  min-width: 26px;
  flex-shrink: 0;
  padding-right: 4px;
  color: #666;
}

.m-filter-scroll {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  max-height: 26px;
  overflow: hidden;
  transition: max-height 0.25s ease;
  z-index: 2;
  align-content: flex-start;
}

.m-filter-scroll.expanded { max-height: 300px; overflow-y: auto; z-index: 3; }
.m-filter-scroll::-webkit-scrollbar { display: none; }

.filter-tags { display: contents; gap: 4px; align-items: center; }

.filter-tag {
  padding: 2px 9px;
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  border-radius: 20px;
  border: none;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.6;
}

.filter-tag:hover { background: #e0e0e0; }
.filter-tag.active { background: #ffd700; color: #333; font-weight: bold; }

.hide-tag { display: none; }
.m-filter-scroll.expanded .hide-tag { display: inline-block; }

.m-filter-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-left: 4px;
  background: rgba(0,0,0,0.08);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  font-size: 12px;
}

.m-filter-expand.expanded { transform: rotate(180deg); color: #ffd700; }
.m-filter-expand.collapsed { transform: rotate(0deg); }

/* ========== 日期栏 ========== */
.m-date-row {
  font-size: 12px;
  font-weight: bold;
  color: #555;
  padding: 4px 10px;
  background: #fff;
  text-align: center;
  border-bottom: 1px solid #eee;
}

/* ========== 滚动公告栏 ========== */
.m-notice {
  background: #fff7cc;
  padding: 3px 10px;
  font-size: 11px;
  color: #d48806;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #ffe58f;
  max-height: 24px;
  line-height: 24px;
  display: none;
}
.m-notice.show { display: block; }
.m-notice-text {
  display: inline-block;
  animation: m-notice-scroll 25s linear infinite;
}
@keyframes m-notice-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== 商品展示区 ========== */
.m-content { padding-bottom: 60px; }

/* ========== 商品列表行（手机端紧凑3列表格）========== */
.m-product-list { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.m-product-list tr:nth-child(odd) td { background: #f8f8f8; }
.m-product-list tr:nth-child(even) td { background: #fff; }
.m-product-list td {
  padding: 5px 4px;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  min-width: 0;
}
.m-product-list .col-name   { width: 62.5%; text-align: left; }
.m-product-list .col-price  { width: 25%;   text-align: left; white-space: nowrap; }
.m-product-list .col-action{ width: 12.5%; text-align: center; }
.m-product-list .col-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.m-product-list .col-price-text { color: #e4393c; font-weight: bold; white-space: nowrap; }
.m-product-list .col-price-retail { font-size: 10px; color: #999; text-decoration: line-through; margin-left: 4px; }
.m-product-list .col-action-btn {
  color: #1890ff; font-weight: bold; cursor: pointer; font-size: 12px;
}
.m-product-list tr:hover td { background: #e6f7ff !important; }

/* ========== 商品图文网格（2列）========== */
.m-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
}
.m-product-grid-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #eee;
}
.m-product-grid-card img {
  width: 100%; height: 80px; object-fit: contain;
  background: #fafafa;
}
.m-product-grid-card .m-grid-info { padding: 5px; }
.m-product-grid-card .m-grid-name {
  font-size: 11px; color: #333; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}
.m-product-grid-card .m-grid-price { font-size: 11px; color: #e4393c; font-weight: bold; line-height: 1.4; }
.m-grid-price span { display: block; }
.m-product-grid-card .m-grid-buy {
  display: inline-block; margin-top: 3px;
  font-size: 11px; color: #1890ff; cursor: pointer; font-weight: bold;
}

/* ========== 空状态 ========== */
.empty { text-align: center; padding: 40px; color: #999; font-size: 14px; }

/* ========== 底部导航 ========== */
.m-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  z-index: 100;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
}

.m-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  font-size: 10px;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s;
}

.m-nav-item.active { color: #1890ff; }

.m-nav-icon { font-size: 20px; line-height: 1.2; }
.m-nav-label { font-size: 10px; margin-top: 1px; }

.m-nav-badge {
  position: absolute;
  top: 2px;
  right: 12px;
  background: #ff4d4f;
  color: #fff;
  border-radius: 10px;
  padding: 0 4px;
  font-size: 9px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

/* ========== 分类抽屉 ========== */
.m-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: #fff;
  z-index: 10002;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0,0,0,0.15);
}

.m-drawer.active { right: 0; }

.m-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  font-weight: bold;
  background: #fafafa;
}

.m-drawer-close { font-size: 24px; cursor: pointer; color: #999; }
.m-drawer-close:active { color: #333; }

.m-drawer-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.m-drawer-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.m-drawer-tab.active { color: #1890ff; border-bottom-color: #1890ff; font-weight: bold; }

.m-drawer-body { flex: 1; overflow-y: auto; padding: 8px 0; }

.m-drawer-back {
  padding: 8px 16px;
  font-size: 13px;
  color: #1890ff;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.m-drawer-item {
  padding: 10px 16px;
  font-size: 13px;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
}

.m-drawer-item:active { background: #f5f5f5; }
.m-drawer-item.active { color: #1890ff; background: #e6f7ff; }

.m-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10001;
  display: none;
}

.m-drawer-overlay.show { display: block; pointer-events: auto; }

/* ========== 弹窗通用 ========== */
.m-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
}

.m-modal.show { display: block; }

.m-modal-content {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-radius: 14px 14px 0 0;
  max-height: 85vh;
  /* v=20260614e: flex column + sticky header + .m-modal-body 滚动 (HTML 同步加 m-modal-body 包裹) */
  display: flex;
  flex-direction: column;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
  margin: 0;
  max-width: none;
  overflow: hidden;  /* 改在 .m-modal-body: overflow-y: auto */
}

.m-modal-header {
  /* v=20260614e: sticky 顶部, 购物车/我的订单滚动时标题栏不消失 */
  flex-shrink: 0;  /* 不被 flex 压缩 */
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px;
  background: linear-gradient(135deg, #1890ff, #0050b3);
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px 14px 0 0;
  margin: -14px -14px 14px -14px;
}

.m-modal-close {
  font-size: 26px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.m-modal-close:active { color: #fff; }

/* v=20260614e: m-modal-body 是 cartModal/orderModal 内容滚动容器, 与 v=20260614d 同名, 配合 sticky header */
.m-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; }

.m-product-name {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.4;
}

.m-price-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.m-price-item {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 8px 10px;
}

.m-price-label { font-size: 11px; color: #666; }
.m-price-value { font-size: 14px; font-weight: bold; }
.m-price-value.green { color: #52c41a; }
.m-price-value.del { color: #999; text-decoration: line-through; font-weight: normal; }

.m-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.m-qty-row input {
  width: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.m-modal-actions { display: flex; gap: 8px; margin-top: 12px; }

.m-btn-primary {
  flex: 1;
  padding: 11px;
  background: #1890ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.m-btn-primary:active { background: #40a9ff; }

.m-btn-secondary {
  flex: 1;
  padding: 11px;
  background: #f5f5f5;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.m-btn-secondary:active { background: #e0e0e0; }

.m-btn-danger {
  width: 100%;
  padding: 11px;
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 8px;
  cursor: pointer;
}

/* ========== 登录弹窗 ========== */
.m-modal-content h2 { font-size: 16px; margin-bottom: 10px; color: #333; }

.m-modal-content input {
  width: 100%;
  padding: 10px 12px;
  margin: 7px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.m-modal-content input:focus { outline: none; border-color: #1890ff; }

.m-captcha-row { display: flex; gap: 4px; align-items: center; }
.m-captcha-row input { flex: 1; }
.m-captcha-row img { height: 40px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }

.m-modal-content p { font-size: 12px; color: #999; margin-top: 7px; text-align: center; }

/* ========== 购物车 ========== */
.m-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.m-cart-footer { margin-top: 10px; text-align: center; }
.m-cart-footer strong { font-size: 16px; color: #ff4d4f; display: block; margin-bottom: 8px; }

/* ========== 订单 ========== */
.m-order-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
}

.m-order-item p { font-size: 13px; margin: 3px 0; color: #333; }

/* ========== 用户中心 ========== */
#userInfo p { font-size: 14px; margin: 7px 0; color: #333; }

/* ========== 公告栏 ========== */
.m-notice-bar {
  background: #fff7cc;
  padding: 4px 10px;
  font-size: 11px;
  color: #d48806;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #ffe58f;
  max-height: 26px;
}

@keyframes notice-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ========== 商品图片模式（暂无图片占位）========== */
.m-product-img-wrap { margin-bottom: 6px; }

.m-no-image {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  color: #ccc;
  font-size: 12px;
}

/* ========== 登录弹窗：居中悬浮样式 ========== */
#loginModal .m-modal-content {
  position: fixed;
  bottom: 0;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 360px;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 28px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
#loginModal .m-modal-content h2 {
  text-align: center;
  margin-bottom: 16px;
  font-size: 18px;
}
#loginModal .m-modal-content input {
  margin: 6px 0;
}
#loginModal .m-modal-content .m-captcha-row {
  margin: 6px 0;
}
#loginModal .m-modal-content .m-btn-primary,
#loginModal .m-modal-content .m-btn-secondary {
  margin-top: 6px;
}
/* ===== PWA 瀹夊叏鍖哄煙閫傞厤锛堝垬娴峰睆 iPhone锛?==== */
/* viewport-fit=cover 宸茶缃紝body 鍐呭寤朵几鍒板睆骞曡竟缂?*/
/* 鐘舵€佹爮 44px锛屽簳閮?Home Indicator 34px */
@supports (padding-top: env(safe-area-inset-top)) {
  .m-sticky-header {
    padding-top: calc(env(safe-area-inset-top) + 8px);
    background: #fff;
  }
  .m-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .m-modal-content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
  }
}