.compare-wrap { max-width: 1240px; padding-bottom: 24px; }

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(245, 196, 81, .5);
  border-radius: 9px;
  background: rgba(245, 196, 81, .1);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.back-link:hover {
  color: #0b0f15;
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 9px 24px rgba(245, 196, 81, .22);
}

.compare-hero { padding: 34px 0 22px; }
.compare-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(32px, 4.3vw, 56px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 800;
}
.compare-hero h1 span { color: var(--muted); font-weight: 600; }
.compare-hero > p {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.compare-builder { padding: 18px 20px 20px; }
.compare-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}
.selected-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  height: 30px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.selected-chips::-webkit-scrollbar { display: none; }
.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 196, 81, .25);
  background: rgba(245, 196, 81, .07);
  color: var(--text);
  font-size: 10px;
}
.selected-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
}
.selected-chip button:hover { color: var(--red); }
.ghost-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.ghost-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, .18); }

.compare-builder .category-switch { margin-top: 13px; }

.compare-picker {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  height: 160px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 196, 81, .3) rgba(255, 255, 255, .04);
  overscroll-behavior-x: contain;
  overflow-anchor: none;
  cursor: grab;
}
.compare-picker.dragging { cursor: grabbing; scroll-snap-type: none; }
.compare-picker::-webkit-scrollbar { height: 5px; }
.compare-picker::-webkit-scrollbar-thumb { background: rgba(245, 196, 81, .3); border-radius: 5px; }
.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 16px) / 3);
  height: 100%;
  padding: 12px 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .022);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.pick-card:hover { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); }
.pick-card.picked { border-color: var(--card-accent, var(--gold)); background: rgba(255, 255, 255, .06); }
.pick-card.picked::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--card-accent, var(--gold));
  font-size: 12px;
  font-weight: 700;
}
.pick-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pick-name { font-size: 12px; font-weight: 700; line-height: 1.4; }
.pick-price { color: var(--gold); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pick-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pick-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 8px;
}
.pick-why { margin: 7px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }

.compare-result { margin-top: 12px; padding: 18px 20px 20px; }
.result-head { margin-bottom: 8px; }
#compareTable {
  height: 680px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 196, 81, .3) rgba(255, 255, 255, .04);
  overscroll-behavior: contain;
  overflow-anchor: none;
}
#compareTable::-webkit-scrollbar { width: 5px; }
#compareTable::-webkit-scrollbar-thumb { background: rgba(245, 196, 81, .3); border-radius: 5px; }

.compare-empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.compare-empty strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 14px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}
.compare-table th, .compare-table td {
  padding: 12px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  vertical-align: top;
  text-align: left;
  font-size: 10.5px;
  line-height: 1.6;
}
.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #10161f;
  border-bottom-color: rgba(255, 255, 255, .1);
}
.compare-table thead th:first-child,
.compare-table tbody th {
  width: 112px;
  color: var(--faint);
  font-weight: 600;
  font-size: 9px;
  background: rgba(255, 255, 255, .015);
}
.compare-table thead th .th-name { display: block; color: var(--text); font-size: 12px; font-weight: 700; }
.compare-table thead th .th-price { display: block; margin-top: 3px; color: var(--gold); font-size: 12px; font-weight: 700; }
.compare-table thead th .th-remove {
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  cursor: pointer;
  padding: 0;
}
.compare-table thead th .th-remove:hover { color: var(--red); }
.compare-table td { color: var(--muted); }
.compare-table td strong { color: var(--text); font-weight: 600; }
.compare-table .cell-price { color: var(--text); font-size: 14px; font-weight: 700; }
.compare-table .cell-up { color: var(--red); font-weight: 700; }
.compare-table .cell-down { color: var(--green); font-weight: 700; }
.compare-table .cell-flat { color: var(--muted); font-weight: 700; }
.compare-table ul { margin: 0; padding-left: 13px; }
.compare-table li { margin: 2px 0; }
.compare-table .source-links { display: flex; flex-wrap: wrap; gap: 6px; }
.compare-table .source-links a { color: var(--faint); text-decoration: underline; text-underline-offset: 2px; font-size: 9px; }
.compare-table .source-links a:hover { color: var(--gold); }
.compare-table .tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.compare-table .tag-row span {
  display: inline-flex;
  height: 18px;
  align-items: center;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 8px;
}

.table-hint { display: none; }
.compare-mobile { display: none; }
.compare-mobile .m-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, .022);
}
.compare-mobile .m-card + .m-card { margin-top: 8px; }
.m-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.m-card-name { font-size: 14px; font-weight: 700; }
.m-card-price { color: var(--gold); font-size: 16px; font-weight: 800; white-space: nowrap; }
.m-rows { display: grid; gap: 8px; margin-top: 10px; }
.m-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; font-size: 10px; line-height: 1.6; }
.m-row dt { color: var(--faint); font-size: 9px; }
.m-row dd { margin: 0; color: var(--muted); }
.m-row dd strong { color: var(--text); }
.m-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, .06); color: var(--faint); font-size: 9px; }
.m-card-foot .source-links { display: flex; flex-wrap: wrap; gap: 8px; }
.m-card-foot .source-links a { color: var(--faint); text-decoration: underline; text-underline-offset: 2px; }

.compare-disclaimer {
  max-width: 900px;
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .pick-card { flex-basis: calc((100% - 8px) / 2); }
}

@media (max-width: 620px) {
  .compare-wrap { padding: 0 16px 20px; }
  .back-link { min-height: 36px; padding: 0 12px; font-size: 11px; }
  .compare-hero { padding: 20px 0 16px; }
  .compare-hero h1 { font-size: 34px; }
  .compare-hero > p { font-size: 12.5px; }
  .compare-builder { padding: 14px; border-radius: 16px; }
  .compare-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .compare-toolbar .ghost-btn { align-self: flex-end; }
  .compare-builder .category-switch { margin-top: 10px; flex-wrap: nowrap; }
  .compare-picker { gap: 7px; height: 172px; }
  .pick-card { flex-basis: 86%; }
  #compareTable { height: 620px; }
  .pick-card { padding: 11px 12px; }
  .compare-result { padding: 14px; border-radius: 16px; }
  /* 手机端：保留横向对比表，左右滑动看不同型号，不再改成上下堆叠卡片 */
  .table-scroll { display: block; }
  .compare-mobile { display: none; }
  .table-hint {
    display: block;
    margin: 4px 0 8px;
    color: var(--faint);
    font-size: 9px;
    text-align: right;
  }
  .compare-table { min-width: 720px; }
  .compare-table th, .compare-table td { padding: 9px 8px; font-size: 9.5px; }
  .compare-table thead th { font-size: 9px; }
  .compare-table thead th:first-child,
  .compare-table tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 88px;
    background: #10161f;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .06);
  }
  .compare-table thead th:first-child { z-index: 3; }
  .compare-table thead th .th-name { font-size: 10.5px; }
  .compare-table .cell-price { font-size: 12px; }
  .selected-chip { font-size: 9px; }
  .compare-disclaimer { font-size: 9px; }
}
