html, body {
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  background: #f6f8fa;
  color: #222;
}

.top-iframe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  border: none;
  z-index: 1000;
}

.main-content {
  margin-top: 80px;
  width: 96%;
  max-width: 1320px;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  padding: 10px 0 20px 0;
  box-sizing: border-box;
}

/* Filter bar styles */
.filter-bar-card {
  background: #fff;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  margin-bottom: 14px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-row:last-child {
  margin-bottom: 14px;
}
.filter-label {
  color: #555;
  font-size: 16px;
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
  line-height: 36px;
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.filter-btn {
  background: #f6f8fa;
  border: none;
  border-radius: 4px;
  color: #222;
  font-size: 15px;
  padding: 4px 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.filter-btn.active, .filter-btn:hover {
  background: #02542A;
  color: #fff;
}
.filter-select {
  border: 1px solid #e0e7ef;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 15px;
  outline: none;
  min-width: 90px;
  background: #fff;
  transition: border 0.2s;
}
.filter-select:focus {
  border-color: #006633;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.filter-group-label {
  color: #666;
  font-size: 15px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}
.route-arrow {
  font-size: 18px;
  color: #006633;
  flex-shrink: 0;
  font-weight: bold;
}
.search-bar {
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 8px;
  padding: 20px 0 0 0;
}
.location-input-wrapper {
  position: relative;
  display: inline-block;
  width: 450px;
  min-width: 300px;
}

.location-input {
  width: 100%;
  height: 40px;
  border: 1px solid #e0e7ef;
  border-radius: 6px;
  padding: 0 40px 0 16px; /* 右侧留出空间给清除按钮 */
  font-size: 14px;
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.location-input:focus {
  border-color: #006633;
  box-shadow: 0 2px 8px rgba(0,102,51,0.15);
}

.location-input:hover {
  border-color: #006633;
}

.clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.2s;
  z-index: 2;
}

.clear-btn:hover {
  color: #666;
}
.search-btn {
  background: linear-gradient(135deg, #006633, #008844);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,102,51,0.3);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-btn:hover {
  background: linear-gradient(135deg, #004d26, #006633);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,102,51,0.4);
}

/* Goods list and sidebar layout */
.goods-list-wrapper {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  align-items: flex-start;
}
.goods-card-container {
  flex: 3;
  min-width: 0;
  background: #fff;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.goods-sidebar {
  flex: 1;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card list header */
.card-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: bold;
}
.refresh-btn {
  background: #02542A;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  padding: 4px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.refresh-btn:hover {
  background: #014321;
}

/* Goods Card styles */
.goods-card-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 500px; /* 增加最小高度，确保分页切换时无跳动感 */
}


.goods-card {
  display: flex;
  flex-direction: row;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 20px 24px;
  align-items: stretch;
  position: relative;
  margin-bottom: 18px;
  min-height: 140px; /* 设置最小高度而不是固定高度，允许内容撑开 */
  box-sizing: border-box;
  opacity: 1; /* 移除动画，直接显示 */
  transform: none; /* 移除动画 */
}

/* 占位卡片样式 - 用于防止分页抖动 */
.goods-card-placeholder {
  visibility: hidden; /* 隐藏但保持布局空间 */
  min-height: 140px;  /* 与实际卡片高度一致 */
  margin-bottom: 18px; /* 与实际卡片间距一致 */
  animation: none;     /* 禁用动画 */
  opacity: 1;          /* 重置透明度 */
  transform: none;     /* 重置变换 */
}


.goods-card-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 改为顶部对齐，避免居中造成的布局问题 */
  min-height: 100px; /* 设置最小高度，但允许扩展 */
  padding: 10px 0; /* 添加内边距确保内容不会贴边 */
}
.goods-card-col-left {
  flex: 2.2; /* 稍微增加宽度以容纳更多标签 */
  justify-content: flex-start;
  gap: 10px;
}
.goods-card-col-mid {
  flex: 1.1;
  align-items: flex-start;
  justify-content: flex-start; /* 改为顶部对齐 */
  gap: 10px;
  padding-left: 20px;
  padding-right: 20px;
  border-left: 1px solid #f3f3f3;
  border-right: 1px solid #f3f3f3;
}
.goods-card-col-right {
  flex: 1;
  align-items: flex-end;
  justify-content: flex-start; /* 改为顶部对齐，避免space-between造成的分散 */
  gap: 12px; /* 增加间距 */
  text-align: right;
}
.goods-card-route {
  color: #02542A;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
  line-height: 1.3;
  word-break: break-word; /* 允许长地名换行 */
  overflow-wrap: break-word;
}
.goods-card-info {
  color: #666;
  font-size: 15px;
  display: flex;
  flex-direction: column; /* 改为纵向排列，避免横向拥挤 */
  gap: 8px; /* 减少间距 */
  margin-bottom: 8px;
  line-height: 1.4; /* 增加行高提升可读性 */
}
.goods-card-info span {
  word-break: break-word; /* 允许长文本换行 */
  overflow-wrap: break-word;
}
.goods-card-type-desc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.type-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.goods-card-owner {
  font-size: 15px;
  color: #222;
  display: flex;
  align-items: flex-start; /* 改为顶部对齐，适应多行文本 */
  gap: 8px;
  flex-wrap: wrap; /* 允许换行 */
  line-height: 1.4;
}
.owner-contact {
  font-size: 14px;
  color: #222;
  display: flex;
  align-items: flex-start; /* 改为顶部对齐，适应多行文本 */
  gap: 8px;
  flex-wrap: wrap; /* 允许换行 */
  line-height: 1.4;
}
.goods-card-price {
  color: #222;
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 12px;
  word-break: break-word; /* 允许长价格文本换行 */
  overflow-wrap: break-word;
}
.goods-card-times {
  font-size: 13px;
  color: #999;
  text-align: right;
  line-height: 1.4;
  word-break: break-word; /* 允许长时间文本换行 */
  overflow-wrap: break-word;
}
.goods-card-status {
  position: absolute;
  top: 18px;
  right: 24px;
  background: #e6f9f0;
  color: #02542A;
  font-size: 13px;
  border-radius: 4px;
  padding: 2px 10px;
}
.order-btn {
  background: #02542A;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  padding: 6px 22px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}
.order-btn:hover {
  background: #014321;
}

/* 查看货源详情按钮样式 */
.view-detail-btn {
  background: #02542A;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
  white-space: nowrap;
  width: 100%;
  max-width: 120px;
}

.view-detail-btn:hover {
  background: #014321;
}

/* 标签样式 */
.transport-type-tag {
  background: #e6f9f0;
  color: #02542A;
  font-size: 12px;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.category-tag {
  background: #fff2e6;
  color: #d46b08;
  font-size: 12px;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.packaging-tag {
  background: #f6ffed;
  color: #389e0d;
  font-size: 12px;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.department-tag {
  background: #f6f8fa;
  color: #888;
  font-size: 13px;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
}
.credibility-tag {
  background: #e6f9f0;
  color: #02542A;
  font-size: 13px;
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 6px;
}
.certified-tag {
  background: #06a561;
  color: #fff;
  font-size: 13px;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
}

/* Pagination styles */
.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 32px 0 40px 0;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: #f3f3f3;
  color: #222;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}

.page-btn:hover {
  background: #e5e5e5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.page-btn:active {
  transform: translateY(0);
  transition: all 0.1s ease;
}

.page-btn.active {
  background: #02542A;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(2,84,42,0.3);
}

.page-btn.disabled {
  background: #eee;
  color: #bbb;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

/* 点击波纹效果 */
.page-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.page-btn:active:not(.disabled)::before {
  width: 300px;
  height: 300px;
}
.page-ellipsis {
  color: #bbb;
  font-size: 18px;
  padding: 0 4px;
}

/* Modal styles */
#location-modal-mask {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.18);
  z-index: 9999;
}
#location-modal {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13);
  padding: 32px 36px 24px 36px;
  z-index: 10000;
  min-width: 340px;
}
.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: #006633;
  margin-bottom: 18px;
}
.modal-select-group {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.modal-select-group select {
  width: 110px;
  border: 1px solid #e0e7ef;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border 0.2s;
}
.modal-select-group select:focus {
  border-color: #006633;
}
.modal-actions {
  text-align: right;
}
.modal-actions button {
  padding: 6px 22px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
}
#modal-cancel-btn {
  margin-right: 12px;
  background: #eee;
  color: #333;
}
#modal-ok-btn {
  background: #006633;
  color: #fff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .goods-card {
    flex-direction: column; /* 在较小屏幕上改为纵向布局 */
    min-height: auto;
  }
  
  .goods-card-col {
    padding: 8px 0;
    min-height: auto;
  }
  
  .goods-card-col-mid {
    border-left: none;
    border-right: none;
    border-top: 1px solid #f3f3f3;
    border-bottom: 1px solid #f3f3f3;
    padding: 12px 0;
    margin: 8px 0;
  }
  
  .goods-card-col-right {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .main-content {
    width: 98%;
    padding: 10px 0;
  }
  
  .filter-bar-card {
    padding: 15px;
  }
  
  .search-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 15px 0 0 0;
  }
  
  .location-input-wrapper {
    width: 100%;
    min-width: auto;
  }
  
  .location-input {
    font-size: 14px;
  }
  
  .route-arrow {
    align-self: center;
    margin: 0;
  }
  
  .goods-card-container {
    padding: 15px;
  }
  
  .goods-card {
    padding: 15px;
    margin-bottom: 12px;
  }
  
  .goods-card-route {
    font-size: 16px;
  }
  
  .goods-card-info,
  .goods-card-owner {
    font-size: 14px;
  }
  
  .goods-card-price {
    font-size: 20px;
  }
  
  .goods-card-type-desc {
    font-size: 13px;
    gap: 6px;
  }
  
  .type-item {
    font-size: 13px;
  }
  
  .transport-type-tag,
  .category-tag,
  .packaging-tag {
    font-size: 11px;
    padding: 1px 4px;
  }
  
  .view-detail-btn {
    font-size: 13px;
    padding: 6px 12px;
    margin-top: 8px;
    max-width: 100px;
  }
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #ddd;
}

.empty-state-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state-subtext {
  font-size: 14px;
  color: #bbb;
}

/* 加载状态样式 */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.loading-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: #02542A;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    opacity: 0.6;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state-text {
  font-size: 14px;
  margin-bottom: 8px;
  color: #666;
}

 