* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #344054;
  background: #f3f3f3;
  font-family: Arial, 'Microsoft YaHei', sans-serif;
}

[v-cloak] {
  display: none;
}

.layout {
  min-height: 100vh;
}



.main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 0 32px;
}

.filter-band,
.table-panel,
.pager-wrap {
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.filter-band {
  min-height: 92px;
  padding: 20px 20px 4px;
}

.filters .el-form-item {
  margin-bottom: 14px;
}

.search-type {
  width: 102px;
}

.keyword-input {
  width: 214px;
}

.select-input {
  width: 216px;
}

.select-input.wide {
  width: 216px;
}

.table-panel {
  margin-top: 12px;
  overflow: hidden;
}

.panel-title {
  height: 56px;
  line-height: 56px;
  padding: 0 20px;
  color: #111827;
  font-size: 14px;
  border-bottom: 1px solid #e8edf5;
}

.table-wrap {
  padding: 20px;
}

.goods-table.el-table {
  color: #344054;
  font-size: 12px;
}

.goods-table.el-table th,
.goods-table.el-table td {
  padding: 0;
  height: 40px;
}

.goods-table.el-table th {
  background: #fff;
  color: #667085;
  font-weight: 400;
}

.category-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
}

.category-img,
.detail-img {
  width: 50px;
  height: 50px;
  border-radius: 0;
  background: #eef2f7;
  border: 1px solid #e5e7eb;
}

.image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9ca3af;
  font-size: 22px;
}

.goods-link {
  color: #1f2d3d;
  font-weight: 600;
}

.muted {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.type-link {
  color: #1684fc;
}

.pager-wrap {
  margin-top: 12px;
  padding: 12px 16px;
  text-align: right;
}

.dialog-title {
  font-weight: 700;
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.detail-img {
  width: 64px;
  height: 64px;
}

.detail-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.detail-head p {
  margin: 0;
  color: #6b7280;
}

/* PC端的大表格包裹区 */
.table-wrap {
  padding: 20px;
}

/* 移动端卡片列表默认隐藏 */
.mobile-goods-list {
  display: none;
}

@media (max-width: 768px) {
  /* 隐藏 PC 表格独有类 */
  .hidden-xs-only {
    display: none !important;
  }
  
  .panel-title {
    display: none !important;
  }
  
  .table-panel {
    background: transparent !important;
    box-shadow: none !important;
    margin-top: 16px !important;
  }
  

  .main {
    padding: 16px 12px 24px;
  }

  /* 筛选表单重塑为网格布局 */
  .filters {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .filters .el-form-item {
    margin-bottom: 8px !important;
    margin-right: 0 !important;
    width: 100% !important;
    display: block !important;
  }

  .filters .el-form-item__content {
    display: block !important;
    width: 100% !important;
  }

  /* 搜索类型和输入框、代理等级、分类各占一半 */
  .filters .el-form-item:nth-child(1),
  .filters .el-form-item:nth-child(2),
  .filters .el-form-item:nth-child(3),
  .filters .el-form-item:nth-child(4) {
    grid-column: span 1 !important;
  }

  /* 按钮部分横向占满并排 */
  .filters .el-form-item:nth-child(5) {
    grid-column: span 2 !important;
  }

  .filters .el-form-item:nth-child(5) .el-form-item__content {
    display: flex !important;
    gap: 8px !important;
  }

  .filters .el-form-item:nth-child(5) .el-button {
    flex: 1;
    margin-left: 0 !important;
  }

  /* 控件百分百宽度 */
  .keyword-input,
  .select-input,
  .select-input.wide,
  .search-type,
  .el-cascader {
    width: 100% !important;
  }

  /* 分页器精简化展示 */
  .el-pagination .el-pagination__sizes,
  .el-pagination .el-pagination__jump {
    display: none !important;
  }
  
  .pager-wrap {
    padding: 12px 6px !important;
    text-align: center !important;
  }

  /* 详情弹窗在手机下的优化 */
  .detail-dialog {
    width: 95% !important;
  }

  .detail-dialog .el-dialog__body {
    padding: 12px 16px 20px !important;
  }
  
  .detail-dialog .el-table {
    font-size: 11px !important;
  }
  
  .detail-dialog .el-table td, 
  .detail-dialog .el-table th {
    padding: 6px 0 !important;
    height: auto !important;
  }
  
  /* 展示移动端卡片列表 */
  .mobile-goods-list {
    display: block !important;
    padding: 0 12px 12px;
  }
}

/* ================= 移动端卡片式商品列表 ================= */
.mobile-goods-list .empty-text {
  text-align: center;
  padding: 40px 0;
  color: #9ca3af;
  font-size: 14px;
}

.mobile-goods-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-goods-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  background: #fafafa;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-category {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px 10px 4px 6px;
  border-radius: 100px;
  max-width: 70%;
}

.card-category-img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.card-category-name {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-goods-type {
  font-size: 11px;
  color: #3b82f6;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.card-body {
  margin-bottom: 16px;
}

.card-goods-id {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
  font-family: monospace;
}

.card-goods-name {
  font-size: 15px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-all;
}

.card-prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}

.price-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.price-level-name {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
  white-space: nowrap;
}

.price-value {
  font-size: 13px;
  color: #0f172a;
  font-weight: 700;
}
