:root {
  color-scheme: light;
  --ink: #111;
  --muted: #5c5c5c;
  --line: #e4e4e4;
  --bg: #fff;
  --wa: #128c7e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    system-ui,
    Segoe UI,
    PingFang TC,
    Noto Sans CJK TC,
    Microsoft JhengHei,
    sans-serif;
  font-size: 18px;
  line-height: 1.5;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
}
h1 {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}
p {
  margin: 0;
}
button,
input {
  font: inherit;
  color: inherit;
}
.wrap {
  width: min(1100px, calc(100% - 32px));
  margin-inline: auto;
}
main {
  padding: 24px 0 48px;
}
.site-header {
  background: #000;
  color: #fff;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-name {
  display: block;
  font-weight: 700;
}
.brand-sub {
  display: block;
  color: #cfcfcf;
  font-size: 14px;
}
.site-footer {
  background: #000;
  color: #d0d0d0;
  padding: 28px 0 40px;
}
.site-footer .wrap {
  display: grid;
  gap: 8px;
}
.site-footer strong,
.site-footer a {
  color: #fff;
}
.intro {
  font-size: 1.15rem;
  max-width: 40rem;
}
.intro-sub {
  margin-top: 6px;
  color: var(--muted);
  max-width: 40rem;
}
.search {
  margin: 28px 0 36px;
}
.search label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
.search-row {
  display: grid;
  gap: 8px;
}
.search input {
  width: 100%;
  min-height: 64px;
  padding: 0 16px;
  border: 2px solid #000;
  background: #fff;
  font-size: 1.2rem;
}
.search button {
  min-height: 56px;
  border: 0;
  background: #000;
  color: #fff;
  font-weight: 700;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.tiles-brands,
.tiles-models {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tile {
  display: flex;
  text-decoration: none;
  background: #fff;
  border: 1px solid #000;
  min-width: 0;
  color: inherit;
}
.tile-brand {
  flex-direction: row;
  align-items: center;
  gap: 8px 10px;
  min-height: 44px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
}
.tile-brand .tile-logo {
  height: 22px;
  width: auto;
  max-width: 42px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center;
  color: var(--ink);
}
.tile-brand .tile-name {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  min-width: 0;
}
.tile-model {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  min-height: 0;
}
.tile-model .tile-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.tile-code {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}
.shop-slot {
  margin-top: 32px;
  min-height: 180px;
  border: 1px solid #ccc;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 16px;
}
.back {
  margin: 0 0 16px;
}
.back a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lede {
  color: var(--muted);
  margin-bottom: 20px;
}
.group {
  margin-top: 28px;
}
.group h2 span {
  color: var(--muted);
  font-weight: 600;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}
.card {
  border: 1px solid var(--line);
  height: 100%;
  min-width: 0;
  background: #fff;
}
.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  min-width: 0;
}
.frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f3f3f3;
  overflow: hidden;
}
.frame.tall {
  aspect-ratio: 4 / 3;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame:after {
  content: "LAP";
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.card .frame:after {
  right: 4px;
  bottom: 4px;
  padding: 1px 4px;
  font-size: 9px;
}
.card .badge,
.card .sold {
  top: 4px;
  padding: 1px 5px;
  font-size: 10px;
}
.card .badge {
  left: 4px;
}
.card .sold {
  right: 4px;
}
.ph {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
}
.badge,
.sold {
  position: absolute;
  z-index: 1;
  top: 8px;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #000;
  font-size: 13px;
  font-weight: 700;
}
.badge {
  left: 8px;
}
.sold {
  right: 8px;
  background: #000;
  color: #fff;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
  flex: 1;
  min-width: 0;
}
.clamp {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  min-height: 0;
  max-height: 2.5em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .pn {
  font-size: 0.82rem;
}
.card .line,
.card .extra {
  font-size: 0.75rem;
  min-height: 0;
}
.pn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  margin: 0;
}
.pn.big {
  font-size: 1.25rem;
  margin: 8px 0 16px;
}
.line,
.extra {
  color: var(--muted);
  min-height: 1.4em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kicker {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
}
.note,
.explain,
.vin {
  color: var(--muted);
  margin-top: 8px;
}
.sold-line {
  display: inline-block;
  margin: 8px 0;
  padding: 2px 8px;
  background: #000;
  color: #fff;
  font-weight: 700;
}
.spec {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.spec th,
.spec td {
  text-align: left;
  vertical-align: top;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.spec th {
  width: 38%;
  color: var(--muted);
  font-weight: 600;
  padding-right: 16px;
}
.spec th span {
  display: block;
  font-weight: 500;
}
.spec td {
  overflow-wrap: anywhere;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 16px;
  padding: 0 14px;
  border: 1px solid #000;
  text-decoration: none;
  font-weight: 700;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.thumb {
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
}
.thumb.is-on {
  border-color: #000;
}
.thumb .frame,
.thumb img {
  aspect-ratio: 4 / 3;
}
.thumb img {
  width: 100%;
  object-fit: cover;
}
.gallery {
  margin-bottom: 20px;
}
.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--wa);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  text-align: center;
}
.btn-wa.compact {
  min-height: 44px;
  width: auto;
  white-space: nowrap;
  font-size: 15px;
  padding: 0 10px;
}
.fallback {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.sticky .btn-wa {
  width: 100%;
}
body.part {
  padding-bottom: 96px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.tabs a {
  padding: 8px 12px;
  border: 1px solid #000;
  text-decoration: none;
}
.tabs a[aria-current="true"] {
  background: #000;
  color: #fff;
}
.panel {
  padding: 8px 0 24px;
}
.boot {
  color: var(--muted);
}
.admin h1 {
  margin-top: 12px;
}
.stack,
.slot {
  display: grid;
  gap: 12px;
}
.stack label,
.fit-row label,
.filters label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}
.stack input,
.stack select,
.stack textarea,
.filters input,
.filters select,
.fit-row input,
.fit-row select {
  min-height: 48px;
  border: 1px solid #000;
  padding: 8px 10px;
  background: #fff;
  font-weight: 400;
}
.stack textarea {
  min-height: 96px;
}
.slot {
  margin: 16px 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.slot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  background: #000;
  color: #fff;
  font-weight: 700;
  position: relative;
}
.slot-btn input {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
}
button.black,
.file-btn,
.row-actions button:not(.btn-wa) {
  min-height: 48px;
  border: 1px solid #000;
  background: #fff;
  font-weight: 700;
  padding: 0 12px;
}
.admin-bar,
.row-actions,
.filters {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.admin-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  gap: 8px;
}
.admin-list button {
  width: 100%;
  text-align: left;
  min-height: 64px;
  border: 1px solid #000;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.admin-list em {
  font-style: normal;
  font-weight: 700;
}
.fit-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}
.file-btn input {
  display: none;
}
@media (min-width: 720px) {
  .admin-bar,
  .filters,
  .row-actions {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
  .fit-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 720px) {
  .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .search button {
    min-width: 120px;
  }
  .tiles,
  .tiles-models {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .tiles-brands {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1040px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.admin-list button.has-thumb {
  grid-template-columns: 72px 1fr;
  column-gap: 12px;
  align-items: center;
}
.admin-list .mini {
  grid-row: span 3;
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #f3f3f3;
  display: block;
}
.admin-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.admin-thumbs figure {
  margin: 0;
  display: grid;
  gap: 4px;
}
.admin-thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.admin-thumbs figcaption {
  font-size: 13px;
  color: var(--muted);
  text-transform: capitalize;
}
.admin-thumbs button {
  min-height: 36px;
  border: 1px solid #000;
  background: #fff;
  font-size: 13px;
}
