:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1f2524;
  --muted: #687270;
  --line: #d9dfdc;
  --accent: #c4512a;
  --accent-dark: #923d22;
  --forest: #263c34;
  --sand: #d6c7aa;
  --ok: #1f7a48;
  --shadow: 0 14px 36px rgba(30, 40, 37, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #eef1ee 0%, var(--bg) 38%, #ffffff 100%);
  color: var(--ink);
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 38px clamp(18px, 4vw, 56px) 24px;
  background: var(--forest);
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sand);
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  max-width: 760px;
  margin: 14px 0 0;
  color: #dbe4df;
  font-size: 16px;
  line-height: 1.7;
}

.source-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: #edf4f0;
  font-size: 13px;
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 32px) 54px;
}

.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-box {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid var(--forest);
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
}

.search-icon {
  font-size: 24px;
  color: var(--accent-dark);
}

input[type="search"] {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 18px;
  color: var(--ink);
  background: transparent;
}

button,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.filter-chip:hover,
.detail-link:hover,
.back-link:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: #f9faf8;
  color: var(--muted);
  cursor: pointer;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 22px 0 14px;
}

.summary-row p {
  margin: 0;
  color: var(--muted);
}

select {
  padding: 0 12px;
}

.vehicle-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.vehicle-selector label {
  display: grid;
  gap: 6px;
}

.vehicle-selector span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.vehicle-selector select {
  width: 100%;
  background: #f9faf8;
}

.vehicle-selector select:disabled {
  color: #9ba5a1;
  cursor: not-allowed;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.product-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 40, 37, 0.08);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover,
.product-card:focus {
  border-color: rgba(196, 81, 42, 0.6);
  box-shadow: 0 12px 30px rgba(30, 40, 37, 0.14);
  outline: 0;
  transform: translateY(-2px);
}

.image-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  min-height: 180px;
  overflow-x: auto;
  background: #e9ede9;
}

.image-strip img {
  width: 100%;
  height: 210px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.image-strip .placeholder {
  display: grid;
  place-items: center;
  min-height: 210px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.card-body {
  padding: 16px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.serial {
  color: var(--muted);
  font-size: 13px;
}

.match-label {
  color: var(--ok);
  border: 1px solid rgba(31, 122, 72, 0.28);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: 0;
}

.model {
  margin: 8px 0 14px;
  color: var(--accent-dark);
  font-weight: 700;
  white-space: pre-line;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}

.price-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fafbf9;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.fitment {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.55;
}

.fitment strong {
  color: var(--forest);
}

.fitment p {
  margin: 0;
  white-space: pre-line;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--forest);
  font-weight: 700;
}

pre {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.detail-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--forest);
  font-weight: 800;
  text-decoration: none;
}

.detail-link {
  width: 100%;
  margin-top: 12px;
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.detail-link:hover {
  background: #fff;
}

.back-link {
  flex: 0 0 auto;
}

.detail-layout {
  display: block;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 22px;
}

.detail-gallery,
.detail-info,
.detail-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(30, 40, 37, 0.08);
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.detail-gallery img {
  width: 100%;
  min-height: 260px;
  max-height: 420px;
  object-fit: contain;
  padding: 16px;
  background: #fff;
}

.detail-info {
  align-self: start;
  padding: 20px;
  position: sticky;
  top: 18px;
}

.detail-info h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.detail-price-grid {
  margin-top: 18px;
}

.detail-section {
  grid-column: 1 / -1;
  padding: 20px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.full-fitment {
  margin-top: 16px;
}

.fitment-section p {
  max-width: 980px;
}

@media (max-width: 720px) {
  .app-header {
    display: block;
    padding-top: 28px;
  }

  .source-badge {
    display: inline-block;
    margin-top: 18px;
  }

  .search-row,
  .summary-row,
  .vehicle-selector {
    display: grid;
    grid-template-columns: 1fr;
  }

  .price-grid {
    grid-template-columns: 1fr;
  }

  .detail-shell {
    grid-template-columns: 1fr;
  }

  .detail-info {
    position: static;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }
}
