:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #dbe2ea;
  --soft: #f5f7fa;
  --panel: #fff;
  --blue: #0d6efd;
  --red: #dc3545;
  --green: #198754;
  --yellow: #ffc107;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(219,226,234,.9);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 900; }
.logo {
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 10px;
  background: conic-gradient(from 220deg, #f9ce34, #b91c5c, #5851db, #f9ce34);
}
.logo span { display: block; position: relative; width: 100%; height: 100%; border-radius: 8px; background: #fff; }
.logo span::before { content: ""; position: absolute; inset: 8px; border: 2px solid var(--ink); border-radius: 7px; }
.logo span::after { content: ""; position: absolute; top: 8px; right: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink); }
.nav { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 850; }
.nav a { padding: 10px 12px; border-radius: 8px; color: #374151; }
.nav a:hover, .nav a.is-active { color: #111827; background: #eef2f7; }
.nav .cta { color: #fff; background: linear-gradient(135deg, #405de6, #b91c5c 58%, #f77737); }

.hero {
  padding: 130px 24px 56px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 22%, rgba(64,93,230,.58), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(185,28,92,.48), transparent 38%),
    linear-gradient(135deg, #0f172a, #111827 55%, #311136);
}
.hero-inner { width: min(1180px, 100%); margin: 0 auto; }
.eyebrow { margin: 0 0 12px; color: #f9a8d4; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; }
.hero-copy { max-width: 670px; margin: 18px 0 10px; color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.7; }
.updated { margin: 0; color: rgba(255,255,255,.64); font-size: 13px; }

.content { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 72px; }
.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9eef4;
}
.view-switch a {
  min-width: 150px;
  padding: 10px 18px;
  border-radius: 9px;
  color: #4b5563;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
}
.view-switch a.is-active { color: #fff; background: var(--ink); box-shadow: 0 6px 18px rgba(17,24,39,.16); }
.view-switch .mode-state { display:inline-block; margin-left:6px; padding:2px 6px; border-radius:999px; background:#d8dee7; color:#667085; font-size:10px; line-height:1.2; vertical-align:1px; }
.view-switch a.is-active .mode-state { background:#22c55e; color:#052e16; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-kicker { margin: 0 0 4px; color: #7c3aed; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.section-head h2 { margin: 0; font-size: clamp(30px, 4vw, 44px); }
.section-head > p { max-width: 530px; margin: 0; color: var(--muted); line-height: 1.65; text-align: right; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.stat { padding: 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; margin-bottom: 5px; font-size: 25px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 750; }

.filter-panel {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(15,23,42,.05);
}
.search-row { display: grid; grid-template-columns: minmax(0,1fr) 220px auto; gap: 10px; margin-bottom: 18px; }
.search-row input, .search-row select, .reset-button {
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.search-row input, .search-row select { padding: 0 14px; }
.reset-button { padding: 0 16px; font-weight: 850; }
.filter-group { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 12px; align-items: start; margin-top: 12px; }
.filter-label { padding-top: 8px; color: var(--muted); font-size: 13px; font-weight: 850; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #374151;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}
.chips button:hover { border-color: #94a3b8; }
.chips button.is-active { color: #fff; border-color: var(--ink); background: var(--ink); }

.results-list { display: grid; gap: 14px; }
.result-card {
  display: grid;
  grid-template-columns: 176px minmax(0,1.2fr) minmax(245px,.8fr) 148px;
  gap: 20px;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(15,23,42,.045);
}
.result-photo { min-height: 146px; background: #e5e7eb; }
.result-photo.is-empty { display: grid; place-items: center; color: #64748b; font-size: 42px; }
.result-main, .result-price, .result-side { padding: 18px 0; }
.result-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 10px; }
.source-badge, .status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.source-automart { color: #fff; background: var(--blue); }
.source-court { color: #fff; background: var(--red); }
.source-onbid { color: #fff; background: var(--green); }
.source-infocar { color: #212529; background: var(--yellow); }
.status-won { color: #fff; background: #1d4ed8; }
.status-failed { color: #fff; background: #6b7280; }
.status-cancelled { color: #fff; background: #b91c1c; }
.status-relisted { color: #fff; background: #7c3aed; }
.status-pending { color: #334155; background: #e2e8f0; }
.result-main h3 { margin: 0 0 9px; font-size: 20px; line-height: 1.35; }
.identity, .place, .price-caption { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.result-price { align-self: center; padding-right: 6px; }
.price-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
.final-price { display: block; margin-bottom: 7px; font-size: 23px; font-weight: 950; letter-spacing: -.03em; }
.price-flow { color: #475569; font-size: 13px; line-height: 1.55; }
.ratio { display: inline-block; margin-top: 8px; color: #1d4ed8; font-size: 12px; font-weight: 900; }
.result-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-right: 18px;
}
.result-date { color: #475569; font-size: 13px; font-weight: 800; }
.bidder { margin-top: 7px; color: var(--muted); font-size: 12px; }
.original-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 13px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
}
.original-link:hover { border-color: #64748b; }
.message { padding: 42px 24px; border: 1px dashed #cbd5e1; border-radius: 16px; color: var(--muted); background: #fff; text-align: center; }
.load-more-wrap { display: flex; justify-content: center; padding: 24px 0 8px; }
.load-more { min-height: 46px; padding: 0 24px; border: 0; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 900; }
.notice { margin-top: 34px; padding: 20px 22px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; }
.notice strong { display: block; margin-bottom: 5px; }
.notice p { margin: 0; color: #6b5b24; font-size: 13px; line-height: 1.7; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px max(24px, calc((100% - 1180px) / 2));
  color: #fff;
  background: #111827;
}
footer p { margin: 8px 0 0; color: rgba(255,255,255,.65); }
.footer-links { display: flex; align-items: center; gap: 16px; font-weight: 800; }
.footer-links a { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .topbar { height: 64px; padding: 0 16px; }
  .nav a { display: none; }
  .hero { padding: 102px 20px 42px; }
  .hero-copy { font-size: 16px; }
  .content { width: min(100% - 28px, 700px); padding-top: 28px; }
  .view-switch { display: grid; width: 100%; }
  .view-switch a { min-width: 0; padding-inline: 10px; }
  .section-head { display: block; }
  .section-head > p { margin-top: 10px; text-align: left; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-bottom: 0; }
  .search-row { grid-template-columns: 1fr; }
  .filter-group { grid-template-columns: 1fr; gap: 5px; }
  .filter-label { padding-top: 0; }
  .result-card { grid-template-columns: 116px minmax(0,1fr); gap: 0 14px; }
  .result-photo { grid-row: 1; min-height: 116px; border-bottom-right-radius: 12px; }
  .result-main { padding: 15px 14px 12px 0; }
  .result-main h3 { font-size: 17px; }
  .result-price { grid-column: 1 / -1; padding: 15px 16px 8px; border-top: 1px solid #eef2f7; }
  .result-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 16px 16px; }
  .result-side .original-link { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  footer { display: block; }
  .footer-links { margin-top: 18px; }
}

@media (max-width: 420px) {
  .brand { gap: 9px; font-size: 17px; }
  .logo { width: 31px; height: 31px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }
  .filter-panel { padding: 15px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .chips button { flex: 0 0 auto; }
  .result-card { grid-template-columns: 104px minmax(0,1fr); }
  .result-photo { min-height: 104px; }
}
