#comparePage {
  height: calc(100vh - var(--header-offset, 70px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.parameter-container {
  height: calc(100vh - var(--header-offset, 70px) - 5vh) !important;
}
.compare-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.compare-table-wrapper {
  flex: 1;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none; /* 防止拖拽时选中文字 */
}

.compare-table-wrapper:active {
  cursor: grabbing;
}

.compare-table {
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
}

.compare-table th,
.compare-table td {
  border-right: 1px solid #DDDDDD;
  border-bottom: 1px solid #DDDDDD;
  background: white;
  padding: 12px 20px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.875rem;
  width: 200px;
  min-width: 200px;
  box-sizing: border-box;
}


.compare-table tbody tr:nth-child(even) td {
  background-color: var(--param-bg);
}

.compare-table tbody tr:nth-child(even) .sticky-col {
  background-color: var(--param-bg) !important;
}

.compare-table thead th,
.compare-table thead td {
  height: 110px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 15;
  border-top: 1px solid #DDDDDD;
  background-clip: padding-box;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: #fff !important;
  z-index: 10;
  color: #666;
  font-weight: normal;
  border-right: 1px solid #DDDDDD;
  border-left: 1px solid #DDDDDD;
  background-clip: padding-box;
}

.first-header-cell {
  color: #000 !important;
  font-weight: 500 !important;
  z-index: 20 !important;
}

.parameter-container .compare-table th,
.parameter-container .compare-table td {
  width: auto;
}
.parameter-container .sticky-col,.parameter-container .first-header-cell {
  max-width: 200px;
}

.car-compare-item .car-name {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  color: #000;
  line-height: 1.4;
  padding: 0 1.875rem 0 0.25rem; /* 右侧给关闭按钮留白，避免遮挡标题 */
  word-break: break-word;
}

.car-compare-item {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-compare {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #666;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.remove-compare:hover {
  border-color: #bbb;
  color: #222;
  background: #fafafa;
}

.price-text {
  font-size: 1rem;
  font-weight: bold;
}

.red-text {
  color: #FF0000;
}

.text-grey {
  color: #999999;
  font-size: 0.75rem;
}

.car-id-text {
  font-size: 0.75rem;
}

.add-compare-box {
  cursor: pointer;
  background: #fff;
  font-size: 0.875rem;
  color: #000;
}

/* 隐藏滚动条样式但保留功能（可选） */
.compare-table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.compare-table-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* 选择车辆弹窗样式 */
#addCarModal {
  display: none;
}

#addCarModal.active {
  display: flex;
}

.car-selector-modal {
  width: 90% !important;
  max-width: 1200px !important;
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.selector-content-wrapper {
  flex: 1;
  overflow: hidden;
}

.selector-section {
  background: #fff;
}

.alphabet-filter span {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.alphabet-filter span:hover,
.alphabet-filter span.active {
  background-color: var(--primary-color);
  color: #000;
}

.brand-item, .series-item, .model-item {
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.125rem;
  gap: 0.5rem;
}

.brand-item:hover, .brand-item.active,
.series-item:hover, .series-item.active,
.model-item:hover {
  background-color: var(--primary-color) ;
  border-color: var(--primary-color) !important;
}

.model-item {
  background: #fff;
}
.model-list-wrapper{
  height: 80%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 最后一步：车辆列表容器
 * 允许内容不足时不显示滚动条轨道，但内容多时仍可滚动 */
.vehicle-list-wrapper{
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none; /* Firefox */
  padding-right: 2px;
}
.vehicle-list-wrapper::-webkit-scrollbar{
  width: 0;
  height: 0;
}

/* 最后一步车辆列表排版优化 */
#compareVehicleList.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem !important;
  margin: 0 !important;
}

#compareVehicleList .col-md-6 {
  width: auto;
  padding: 0 !important;
  margin: 0 !important;
}

#compareVehicleList .model-item {
  min-height: 92px;
  width: 100%;
  padding: 0.75rem !important;
  border-radius: 0.5rem;
  border-color: #e9ecef !important;
  background: #fff;
  transition: all 0.2s ease;
}

#compareVehicleList .model-item .model-name {
  width: 100%;
  color: #111;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#compareVehicleList .model-item .car-id-text {
  color: #8c8c8c;
  font-size: 0.75rem;
}

#compareVehicleList .model-item .model-price {
  margin-top: auto;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}

#compareVehicleList .model-item:hover {
  border-color: var(--primary-color) !important;
  background: #fffef7;
}

/* 步骤指示器样式（移动端） */
.mobile-steps {
  background: #f8f9fa;
}

.step-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 0.875rem;
  color: #999;
  position: relative;
}

.step-item.active {
  color: var(--primary-color);
  font-weight: bold;
}

.step-item.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--primary-color);
}
.model-price{
  width: 25%;
  text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
  
}


@media (min-width: 769px) {
  /* PC端默认隐藏车系和车型，直到选择上级 */
  .section-series, 
  .section-model {
    display: none !important;
  }

  /* 选择品牌后显示车系 */
  #addCarModal.brand-selected .section-series {
    display: block !important;
  }

  /* 选择车系后显示车型 */
  #addCarModal.series-selected .section-model {
    display: block !important;
    flex: 1;
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .model-price{
    width: 40%;
}
  #comparePage {
    height: calc(100vh - var(--header-offset, 70px) - 8vh);
  }
  .parameter-container {
    height: calc(100vh - var(--header-offset, 70px) - 12vh) !important;
  }
  .compare-table th,
  .compare-table td {
    padding: 10px;
    width: 150px;
    min-width: auto;
    font-size: 0.75rem;
  }
  .parameter-container .compare-table th,
  .parameter-container .compare-table td {
    width: 120px;
    height: auto;
  }
  .sticky-col {
    width: 80px !important;
  }
  .car-compare-item .car-name {
    font-size: 0.875rem;
    padding-right: 1.5rem;
  }
  .remove-compare {
    width: 1.125rem;
    height: 1.125rem;
    font-size: 0.85rem;
    top: 0.125rem;
    right: 0.125rem;
  }
  .price-text {
    font-size: 0.875rem;
  }
  .car-id-text{
    flex-direction: column;
  }
  .add-compare-box {
    font-size: 0.75rem;
  }

  .car-selector-modal {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }

  .selector-section {
    display: none !important; /* 移动端默认隐藏 */
    flex: 1;
    overflow-y: auto;
    border-top: none !important;
  }

  /* 根据当前步骤显示对应部分 */
  #addCarModal.step-1 .section-brand { display: block !important; }
  #addCarModal.step-2 .section-series { display: block !important; }
  #addCarModal.step-3 .section-model { display: block !important; }

  .selector-content-wrapper {
    height: calc(100% - 100px); /* 减去 header 和 steps 的高度 */
  }

  #compareVehicleList.row {
    grid-template-columns: 1fr;
    gap: 0.5rem !important;
  }

  #compareVehicleList .model-item {
    min-height: 84px;
    padding: 0.625rem !important;
  }
}
