@media (max-width: 768px) {
/* ============================================================
   手机版样式（max-width: 768px）
   PC端完全独立，不受手机版任何影响
   ============================================================ */


/* ---- 手机端滚动公告栏 ---- */
#mobileNoticeBar {
  background: #fff7cc;
  padding: 4px 10px;
  font-size: 11px;
  color: #d48806;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid #ffe58f;
  max-height: 26px;
  display: none;
}
#mobileNoticeBar.has-notice { display: block; }
#mobileNoticeText {
  display: inline-block;
  white-space: nowrap;
  animation: notice-scroll 20s linear infinite;
}
@keyframes notice-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ---- 手机端搜索栏 ---- */
.mobile-search-bar {
  position: sticky; top: 0; z-index: 200;
  background: linear-gradient(135deg, #1890ff, #0050b3);
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.mobile-search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 4px 8px;
}
.mobile-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  padding: 4px;
  outline: none;
  color: #333;
}
.mobile-search-box button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}


/* ========== 手机端底部导航 ========== */
.mobile-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 50px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  z-index: 500;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
}
.mobile-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;
}
.mobile-nav-item.active { color: #1890ff; }
.nav-icon { font-size: 20px; line-height: 1.2; }
.nav-label { font-size: 10px; margin-top: 1px; }
.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;
}

/* ========== 手机端分类抽屉 ========== */
.category-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);
}
.category-drawer.active { right: 0; }
.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;
}
.drawer-close { font-size: 24px; cursor: pointer; color: #999; }
.drawer-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #fff;
}
.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;
}
.drawer-tab.active { color: #1890ff; border-bottom-color: #1890ff; font-weight: bold; }
.drawer-sub-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.drawer-back-btn {
  padding: 8px 16px; font-size: 13px; color: #1890ff; cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.drawer-sub-item {
  padding: 10px 16px; font-size: 13px; color: #333;
  border-bottom: 1px solid #f5f5f5; cursor: pointer;
}
.drawer-sub-item:hover { background: #f5f5f5; }
.drawer-sub-item.active { color: #1890ff; background: #e6f7ff; }

/* ========== 商品详情弹窗（手机端）========== */
#productModal .modal-content {
  max-height: 80vh; overflow-y: auto; padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.product-modal-price-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0;
}
.product-modal-price-grid.svip { grid-template-columns: repeat(2, 1fr); }
.product-modal-price-item {
  background: #f5f5f5; border-radius: 6px; padding: 8px 10px;
}
.product-modal-price-item .label { font-size: 11px; color: #666; }
.product-modal-price-item .value { font-size: 14px; font-weight: bold; color: #333; }
.product-modal-price-item .value.green { color: #52c41a; }
.product-modal-price-item .value.del { color: #999; text-decoration: line-through; }
.product-modal-qty-row {
  display: flex; align-items: center; gap: 10px; margin: 12px 0;
}
.product-modal-qty-row input {
  width: 80px; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.product-modal-submit {
  width: 100%; padding: 12px; background: #1890ff; color: #fff;
  border: none; border-radius: 8px; font-size: 15px; font-weight: bold;
  cursor: pointer;
}
.product-modal-submit:active { background: #40a9ff; }
.product-modal-name { font-size: 14px; font-weight: bold; color: #333; margin-bottom: 8px; }

/* 确保 content-area 有底部导航的空间 */
.content-area { padding-bottom: 60px; }


/* 手机端列表模式（3列表格） */
.product-grid.list-view {
  display: block !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.product-grid.list-view table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.product-grid.list-view td {
  padding: 4px 3px;
  border: 1px solid #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.product-grid.list-view tr:hover td {
  background: #e6f7ff !important;
}
.product-grid.list-view th {
  padding: 4px 3px;
  border: 1px solid #888;
  font-size: 11px;
  font-weight: bold;
  background: #e8e8e8;
}

idth: 768px) {
  .main-layout { display: block; padding-bottom: 56px; order: 1; }
  .pc-header, .pc-sidebar, .pc-filter-rows { display: none !important; }
  #mobileHeader { display: none !important; }
}


  * { -webkit-tap-highlight-color: transparent; }
  /* ---- 手机版搜索栏（sticky）---- */
  .mobile-search-bar {
  position: sticky; top: 0; z-index: 200;
  background: linear-gradient(135deg, #1890ff, #0050b3);
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
  .mobile-search-bar:first-child { padding-top: env(safe-area-inset-top, 8px); }
  .mobile-search-box {
    display: flex; align-items: center;
    background: #fff; border-radius: 20px; overflow: hidden;
  }
  .mobile-search-box input {
    flex: 1; border: none; outline: none;
    padding: 8px 12px; font-size: 14px; background: transparent; min-width: 0;
  }
  .mobile-search-box button {
    width: 40px; height: 36px; border: none;
    background: transparent; cursor: pointer; font-size: 18px;
  }



  /* ---- 头部区域 ---- */
  #mobileHeader {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: linear-gradient(135deg, #1890ff, #0050b3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding-top: env(safe-area-inset-top, 0);
  }
  body { margin: 0; }
  #app { display: flex !important; flex-direction: column !important; }

  .main-layout { order: 1; display: block; padding-bottom: 56px; }
  .mobile-bottom-nav { order: 2; flex-shrink: 0; }

  .mobile-search-row { padding: 8px 10px; }
  .mobile-search-box {
    display: flex; align-items: center;
    background: #fff; border-radius: 20px; overflow: hidden;
  }
  .mobile-search-box input {
    flex: 1; border: none; outline: none;
    padding: 8px 12px; font-size: 14px; background: transparent; min-width: 0;
  }
  .mobile-search-box button {
    width: 40px; height: 36px; border: none;
    background: transparent; cursor: pointer; font-size: 18px;
  }

  /* ---- 品牌/价格行 ---- */
  .mobile-filter-row {
    font-size: 11px; color: rgba(255,255,255,0.65);
    font-weight: bold; min-width: 26px; flex-shrink: 0; padding-right: 4px;
  }
  /* 滚动容器：折叠时一行高度，展开时不限 */
  .mobile-filter-scroll {
    flex: 1; min-width: 0;
    max-height: 26px; overflow: hidden;
    transition: max-height 0.2s;
    /* 展开时允许 z-index 让遮盖区域可点击 */
    position: relative; z-index: 2;
  }
  .mobile-filter-scroll.expanded { max-height: none; z-index: 3; }
  .mobile-filter-scroll::-webkit-scrollbar { display: none; }

  .filter-tags {
    display: flex; flex-wrap: wrap; gap: 4px;
    align-items: center; min-height: 26px;
  }
  .filter-tag {
    padding: 2px 9px;
    background: rgba(255,255,255,0.15);
    color: #fff; font-size: 12px; border-radius: 20px;
    cursor: pointer; border: none; display: inline-block;
    white-space: nowrap; flex-shrink: 0;
  }
  .filter-tag:hover { background: rgba(255,255,255,0.28); }
  .filter-tag.active { background: #ffd700; color: #333; font-weight: bold; }

  .hide-tag { display: none; }
.mobile-filter-scroll.expanded .hide-tag { display: inline-block; } */
  .filter-expand-btn {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex-shrink: 0; margin-left: 4px;
    background: rgba(255,255,255,0.2); border: none; border-radius: 50%;
    cursor: pointer; color: #fff; font-size: 12px;
  }
  /* 默认折叠（无class）：箭头向下↓ */
  .filter-expand-btn { transform: rotate(0deg); }
  /* 展开后：箭头向上↑ */
  .filter-expand-btn.expanded { transform: rotate(180deg); color: #ffd700; }

  /* ---- 主内容区 ---- */
  .sidebar { display: none !important; }
  .content-area { padding: 3px 4px; }
  .date-row {
    font-size: 12px; font-weight: bold; color: #555;
    padding: 4px 8px; background: #fff;
    border-radius: 6px; text-align: center;
    margin-bottom: 5px; border: 1px solid #eee;
  }
  .product-grid-outer { padding: 0; }

  /* ---- 商品列表（手机端表格） ---- */
  .product-grid-outer { padding: 0; }
  #productList table { border-collapse: collapse; width: 100%; }
  #productList tr:hover td { background: #e6f7ff !important; }

  /* 图文模式 */
  .product-grid.grid-view .product-card-image {
    background: #fff; border-radius: 6px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  .product-grid.grid-view img { width: 100%; height: 90px; object-fit: cover; }
  .product-grid.grid-view .product-info { padding: 6px; }
  .product-grid.grid-view .product-name {
    font-size: 12px; color: #333; line-height: 1.3; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal;
  }
  .product-grid.grid-view .product-price { font-size: 13px; color: #ff4d4f; font-weight: bold; margin-top: 2px; }
  .product-grid.grid-view .product-price del { display: none; }
  .product-grid.grid-view .product-extra { display: none; }
  .product-grid.grid-view .product-actions { display: flex; flex-direction: row; align-items: center; gap: 4px; margin-top: 4px; }
  .product-grid.grid-view .quantity-input { width: 40px; padding: 3px; font-size: 12px; }
  .product-grid.grid-view .btn-buy { font-size: 12px; padding: 3px 8px; }

  /* 手机图文版：2列左右分屏，适配PC风格 */
  .product-grid.grid-view {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    padding: 6px;
  }
  .product-grid.grid-view .product-card-image {
    background: #fff; border-radius: 4px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #eee;
  }
  .product-grid.grid-view img { width: 100%; height: 80px; object-fit: cover; }
  .product-grid.grid-view .no-image { height: 80px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; color: #999; font-size: 12px; }
  .product-grid.grid-view .product-info { padding: 5px; }
  .product-grid.grid-view .product-name {
    font-size: 11px; color: #333; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    white-space: normal; word-break: break-all;
  }
  .product-grid.grid-view .product-price { font-size: 12px; color: #ff4d4f; font-weight: bold; }
  .product-grid.grid-view .product-price del { font-size: 10px; color: #bbb; }
  .product-grid.grid-view .product-extra { display: none; }
  .product-grid.grid-view .product-actions {
    display: flex; flex-direction: row; align-items: center;
    gap: 4px; margin-top: 3px;
  }
  .product-grid.grid-view .quantity-input { width: 38px; padding: 2px; font-size: 11px; }
  .product-grid.grid-view .btn-buy { font-size: 11px; padding: 2px 6px; }
  .product-grid.grid-view .btn-buy {
    flex: 1; padding: 4px; font-size: 12px; background: #1890ff; color: #fff;
    border: none; border-radius: 4px; cursor: pointer;
  }
  #viewListBtn2, #viewGridBtn2 { display: none !important; }

  /* ---- 商品详情弹窗 ---- */
  .product-modal-header {
    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;
  }
  .product-modal-header .close {
    color: #fff; font-size: 22px; cursor: pointer; background: none; border: none; padding: 4px; line-height: 1;
  }
  .product-modal-body { padding: 16px; }
  .product-modal-name { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 12px; line-height: 1.4; }
  .product-modal-price-grid { display: grid; gap: 4px; margin-bottom: 14px; }
  /* 普通/会员：2列2行 */
  .product-modal-price-grid { grid-template-columns: 1fr 1fr; }
  /* 超级会员：3列2行 */
  .product-modal-price-grid.svip { grid-template-columns: 1fr 1fr 1fr; }
  .product-modal-price-item { background: #f5f5f5; border-radius: 6px; padding: 8px 10px; }
  .product-modal-price-item .label { font-size: 11px; color: #999; margin-bottom: 2px; }
  .product-modal-price-item .value { font-size: 15px; font-weight: bold; color: #ff4d4f; }
  .product-modal-price-item .value.green { color: #52c41a; }
  .product-modal-price-item .value.del { text-decoration: line-through; color: #999; font-size: 13px; }
  .product-modal-qty-row {
    display: flex; align-items: center; gap: 4px; margin-bottom: 12px;
    background: #f9f9f9; border-radius: 8px; padding: 10px;
  }
  .product-modal-qty-row label { font-size: 13px; color: #555; flex-shrink: 0; }
  .product-modal-qty-row input {
    flex: 1; padding: 8px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 14px; text-align: center;
  }
  .product-modal-actions { display: flex; flex-direction: column; gap: 4px; }
  .btn-add-cart {
    width: 100%; padding: 12px; background: #1890ff; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer;
  }
  .btn-add-cart:active { background: #40a9ff; }
  .btn-direct-buy {
    width: 100%; padding: 12px; background: #52c41a; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; font-weight: bold; cursor: pointer;
  }
  .btn-direct-buy:active { background: #3a9c14; }

  /* ---- 底部固定菜单 ---- */
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #eee; z-index: 9998;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: 50px; align-items: stretch;
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px; border: none; background: none; cursor: pointer; color: #999; font-size: 10px;
    position: relative; padding: 0; min-width: 0;
  }
  .mobile-nav-item .nav-icon { font-size: 20px; line-height: 1; }
  .mobile-nav-item span:not(.nav-icon):not(.cart-badge) { line-height: 1.2; }
  .mobile-nav-item.active { color: #1890ff; }
  .mobile-nav-item:active { opacity: 0.65; }
  .cart-badge {
    position: absolute; top: 2px; right: 6px;
    background: #ff4d4f; color: #fff; font-size: 9px;
    min-width: 15px; height: 15px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 2px; font-weight: bold;
  }

  /* ---- 分类抽屉 ---- */
  .category-drawer { display: none; }
  .category-drawer.active { display: block; }
  .drawer-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 10001;
  }
  .drawer-panel {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 72%; max-width: 280px; background: #fff; z-index: 10002;
    display: flex; flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  }
  .drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: linear-gradient(135deg, #1890ff, #0050b3);
    color: #fff; font-size: 15px; font-weight: bold; flex-shrink: 0;
  }
  .drawer-header button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; padding: 4px; }
  .drawer-body { display: flex; flex: 1; overflow: hidden; }
  .drawer-tabs {
    width: 72px; background: #f5f5f5; flex-shrink: 0;
    overflow-y: auto; border-right: 1px solid #eee;
  }
  .drawer-tab {
    display: block; width: 100%; padding: 12px 6px; border: none;
    background: none; font-size: 11px; color: #666; cursor: pointer;
    text-align: center; border-bottom: 1px solid #eee;
  }
  .drawer-tab.active { background: #fff; color: #1890ff; font-weight: bold; border-right: 2px solid #1890ff; }
  .drawer-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .drawer-sub-list { padding: 6px 0; }
  .drawer-back-btn { padding: 8px 12px; font-size: 12px; color: #999; cursor: pointer; border-bottom: 1px solid #eee; background: #fafafa; }
  .drawer-sub-item {
    padding: 9px 12px; font-size: 13px; color: #333;
    border-bottom: 1px solid #f5f5f5; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
  }
  .drawer-sub-item:hover, .drawer-sub-item:active { background: #e6f7ff; color: #1890ff; }
  .drawer-sub-item.active { background: #1890ff; color: #fff; }
  .empty { text-align: center; padding: 24px; color: #999; font-size: 13px; }

  /* ---- 弹窗 ---- */
  .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 10003; }
  /* 商品详情弹窗（手机专用，居中弹出） */
  #productModal .modal-content {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 400px;
    max-height: 85vh; overflow-y: auto;
    background: #fff; border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    margin: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  }
  #productModal { background: rgba(0,0,0,0.5); }

  /* 其他弹窗（登录/购物车/用户中心）：底部弹出 */
  .modal:not(#productModal) .modal-content {
    position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
    background: #fff; border-radius: 14px 14px 0 0;
    max-height: 85vh; overflow-y: auto; padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
    box-sizing: border-box; margin: 0; max-width: none;
  }
  .modal-content h2 { font-size: 16px; margin-bottom: 10px; color: #333; }
  .close { float: right; font-size: 26px; color: #999; cursor: pointer; line-height: 1; padding: 4px 8px; }
  .close:hover { color: #333; }
  .btn-primary { width: 100%; padding: 11px; background: #1890ff; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: bold; margin-top: 8px; }
  .btn-secondary { width: 100%; padding: 11px; background: #f5f5f5; color: #333; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; margin-top: 8px; }
  .btn-danger { width: 100%; padding: 11px; background: #ff4d4f; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; margin-top: 8px; }
  .btn-primary:active { background: #40a9ff; }
  .btn-secondary:active { background: #e0e0e0; }
  .btn-danger:active { opacity: 0.85; }
  .modal-content input, .modal-content select {
    width: 100%; padding: 10px 12px; margin: 7px 0;
    border: 1px solid #ddd; border-radius: 8px; font-size: 14px; box-sizing: border-box;
  }
  .modal-content input:focus { outline: none; border-color: #1890ff; }
  .captcha-row { display: flex; gap: 4px; align-items: center; }
  .captcha-row input { flex: 1; }
  .captcha-row img { height: 40px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
  .modal-content p { font-size: 12px; color: #999; margin-top: 7px; text-align: center; }
  #userInfo p { font-size: 14px; margin: 7px 0; color: #333; }
  .cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; }
  .cart-footer { margin-top: 10px; text-align: center; }
  .cart-footer strong { font-size: 16px; color: #ff4d4f; display: block; margin-bottom: 8px; }
  .order-item { border: 1px solid #eee; border-radius: 8px; padding: 10px; margin-bottom: 8px; background: #fff; }
  .order-item p { font-size: 13px; margin: 3px 0; color: #333; }
  .product-grid { overflow-y: auto; -webkit-overflow-scrolling: touch; }

}

