/* ===== 产品对比功能 ===== */

/* --- 复选框列 --- */
.model-table thead th.col-compare {
  width: 80px;
  min-width: 80px !important;
  max-width: 80px !important;
  text-align: center;
}
.model-table tbody td.col-compare {
  width: 80px;
  min-width: 80px !important;
  max-width: 80px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.model-table td.col-compare input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #00a9e0;
}
.model-table td.col-compare input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* --- 底部对比信息栏 --- */
.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1f2a44;
  color: #fff;
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  padding: 0;
}
.compare-bar.visible {
  transform: translateY(0);
}
.compare-bar-inner {
  max-width: 1904px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
}
.compare-bar-label {
  white-space: nowrap;
  font-size: 14px;
  color: #8ab4f8;
  flex-shrink: 0;
}
.compare-bar-items {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  align-items: center;
}
.compare-bar-items::-webkit-scrollbar {
  height: 4px;
}
.compare-bar-items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}
.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-tag-series {
  color: #8ab4f8;
  font-size: 11px;
  margin-right: 2px;
}
.compare-tag-model {
  color: #fff;
  font-weight: 500;
}
.compare-tag-remove {
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  line-height: 1;
  margin-left: 4px;
  transition: color 0.2s;
}
.compare-tag-remove:hover {
  color: #ff6b6b;
}
.compare-bar-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  flex-shrink: 0;
}
.compare-bar-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}
.btn-compare-start {
  background: #00a9e0;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-compare-start:hover {
  background: #0090c0;
}
.btn-compare-clear {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-compare-clear:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* --- 对比弹窗 --- */
.compare-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
.compare-modal-overlay.active {
  display: flex;
}
.compare-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  overflow: hidden;
}
.compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.compare-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1f2a44;
}
.compare-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  line-height: 1;
}
.compare-modal-close:hover {
  color: #000;
}
.compare-modal-body {
  overflow: auto;
  flex: 1;
  padding: 0;
}
.compare-table-wrap {
  min-width: 100%;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.compare-table th,
.compare-table td {
  border: 1px solid #e0e0e0;
  padding: 12px 20px;
  text-align: center;
  vertical-align: middle;
}
.compare-table thead th {
  background: #1f2a44;
  color: #fff;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}
.compare-table thead th:first-child {
  background: #f5f5f5;
  color: #333;
  min-width: 140px;
  left: 0;
  z-index: 2;
}
.compare-table tbody th {
  background: #f5f5f5;
  color: #333;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
}
.compare-table tbody td {
  background: #fff;
}
.compare-table .col-delete-header {
  background: #f5f5f5 !important;
  color: #333 !important;
  min-width: 60px;
}
.compare-table .col-delete {
  vertical-align: middle;
}
.btn-compare-delete {
  background: #ff4d4f;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-compare-delete:hover {
  background: #d9363e;
}
.compare-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 24px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.btn-export-pdf {
  background: #00a9e0;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-export-pdf:hover {
  background: #0090c0;
}
.btn-compare-add-stack {
  background: #fff;
  border: 1px solid #d0d0d0;
  color: #666;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-compare-add-stack:hover {
  border-color: #e53935;
  color: #e53935;
}

/* --- 响应式 --- */
@media screen and (max-width: 1239px) {
  .compare-bar-inner {
    padding: 10px 12px;
    gap: 10px;
  }
  .compare-tag {
    padding: 3px 8px;
    font-size: 12px;
  }
  .compare-modal {
    max-width: 98vw;
    max-height: 95vh;
    border-radius: 4px;
  }
}
