:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e4e9f2;
  --line-strong: #c8d7f5;
  --text: #172033;
  --muted: #69758a;
  --faint: #9aa6b8;
  --blue: #235cff;
  --blue-strong: #164edb;
  --blue-soft: #eef4ff;
  --orange: #ff6830;
  --green: #08b26b;
  --shadow: 0 14px 36px rgba(28, 48, 86, 0.08);
  --radius: 8px;
  --content-width: 1240px;
  --page-gutter: clamp(56px, 8vw, 180px);
  font-size: 14px;
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.chain-hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(118deg, rgba(15, 37, 78, 0.98), rgba(30, 73, 158, 0.96)),
    radial-gradient(circle at 80% 20%, rgba(119, 170, 255, 0.22), transparent 32%);
  overflow: hidden;
}

.chain-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  width: min(var(--content-width), calc(100vw - var(--page-gutter) * 2));
  min-height: 132px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  isolation: isolate;
}

.hero-inner::before {
  content: "";
  position: absolute;
  inset: -30px -120px;
  z-index: -1;
  opacity: 0.09;
  background-image:
    linear-gradient(90deg, transparent 31px, rgba(255, 255, 255, 0.6) 32px, transparent 33px),
    linear-gradient(0deg, transparent 31px, rgba(255, 255, 255, 0.6) 32px, transparent 33px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, #000, transparent 90%);
}

.hero-inner p {
  margin: 0 0 7px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

.hero-inner h1 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 38px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-inner span {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 600;
}

.chain-tabs {
  padding: 18px 0 24px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
}

.tabs-inner {
  width: min(var(--content-width), calc(100vw - var(--page-gutter) * 2));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chain-tab {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4e5c72;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 48, 98, 0.04);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.chain-tab strong {
  font-size: 13px;
  font-weight: 600;
}

.chain-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4cddc;
}

.chain-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28, 48, 86, 0.08);
}

.chain-tab.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(35, 92, 255, 0.18);
}

.chain-tab.is-active .chain-dot {
  background: rgba(255, 255, 255, 0.9);
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
  animation: rise 0.35s ease both;
}

.layout {
  width: min(var(--content-width), calc(100vw - var(--page-gutter) * 2));
  margin: 24px auto 64px;
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 24px;
}

.filters {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(39, 58, 89, 0.04);
}

.filter-group + .filter-group {
  margin-top: 22px;
}

.filter-group h2 {
  margin: 0 0 10px;
  color: #7b8798;
  font-size: 13px;
  font-weight: 700;
}

.filter-button {
  width: 100%;
  min-height: 34px;
  margin-bottom: 4px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 6px;
  color: #42516a;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.filter-button:hover,
.filter-button.is-active {
  color: var(--blue);
  background: #f0f5ff;
  font-weight: 700;
}

.filter-count {
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: #dfeaff;
  text-align: center;
  font-size: 12px;
}

.products-area {
  min-width: 0;
}

.sort-bar,
.product-card,
.detail-media,
.detail-info,
.company-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.catalog-search {
  width: min(360px, 100%);
  height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(18, 38, 74, 0.04);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.catalog-search:focus-within {
  border-color: rgba(35, 92, 255, 0.55);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(35, 92, 255, 0.1),
    0 8px 18px rgba(31, 72, 150, 0.08);
}

.catalog-search span {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid #8b98ad;
  border-radius: 50%;
}

.catalog-search span::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: #8e9aae;
  transform: rotate(45deg);
}

.catalog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}

.catalog-search input::placeholder {
  color: #8e99aa;
}

.sort-bar {
  min-height: 62px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr auto;
  align-items: center;
  gap: 18px;
  box-shadow: 0 8px 22px rgba(39, 58, 89, 0.035);
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #7a8596;
}

.sort-options button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #4a5870;
  background: #f4f7fb;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sort-options button.is-active {
  color: var(--blue);
  outline: 1px solid var(--blue);
  background: #fff;
}

#resultCount {
  color: var(--faint);
  font-size: 14px;
}

.product-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  min-height: 332px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card:hover,
.product-card:focus-within {
  border-color: #7aa2ff;
  box-shadow: 0 18px 34px rgba(37, 99, 255, 0.1);
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  height: 172px;
  background: #eef3fa;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0;
  object-fit: cover;
  filter: none;
  transform: scale(1);
  transition: transform 0.26s ease;
}

.product-card:hover .card-image img {
  transform: scale(1.025);
}

.card-body {
  min-height: 168px;
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.card-tags {
  min-height: 21px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  padding: 3px 7px;
  border-radius: 4px;
  color: var(--blue);
  background: #eaf1ff;
  font-size: 11px;
  font-weight: 700;
}

.badge.orange {
  color: #ff6134;
  background: #fff0e9;
}

.badge.green {
  color: var(--green);
  background: #e9f9f0;
}

.product-card h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  line-height: 1.4;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.model,
.company {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.company {
  color: #6c7585;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-bottom {
  margin-top: auto;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.price {
  color: var(--orange);
  font-size: 21px;
  font-weight: 900;
}

.price small {
  font-size: 13px;
}

.consult-button,
.back-button {
  min-width: 50px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 5px;
  color: var(--blue);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  transition:
    color 0.18s ease,
    background 0.18s ease;
}

.consult-button:hover,
.back-button:hover {
  color: #fff;
  background: var(--blue);
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

.empty-state.is-error {
  color: #c2412d;
  border-color: #f2b6a8;
  background: #fff5f2;
}

.image-missing {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 13px;
  font-weight: 700;
}

.pagination {
  margin-top: 22px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 22px rgba(39, 58, 89, 0.035);
}

.pagination[hidden] {
  display: none;
}

.pagination-summary {
  margin-right: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pagination-button {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #d9e2f0;
  border-radius: 7px;
  color: #40516b;
  background: linear-gradient(180deg, #fff, #f7f9fd);
  box-shadow: 0 1px 2px rgba(18, 38, 74, 0.04);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.pagination-button:hover:not(:disabled) {
  color: var(--blue);
  border-color: rgba(35, 92, 255, 0.45);
  box-shadow: 0 6px 14px rgba(35, 92, 255, 0.1);
}

.pagination-button.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(35, 92, 255, 0.18);
}

.pagination-button:disabled {
  color: #b4bfce;
  background: #f2f5f9;
  cursor: not-allowed;
  box-shadow: none;
}

.pagination-nav {
  min-width: 68px;
}

.detail-view {
  width: min(var(--content-width), calc(100vw - var(--page-gutter) * 2));
  margin: 0 auto 72px;
}

.breadcrumb {
  margin: 28px 0 20px;
  color: #98a2b3;
  font-size: 15px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(440px, 0.9fr) minmax(460px, 1.2fr);
  gap: 32px;
  align-items: start;
}

.detail-media {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.detail-main-image {
  height: 480px;
  display: grid;
  place-items: center;
  background: #f6f9fd;
}

.detail-main-image img {
  max-width: 84%;
  max-height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 24px 32px rgba(19, 39, 78, 0.12));
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
}

.thumb {
  height: 102px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbff;
  cursor: pointer;
}

.thumb.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.thumb img {
  max-width: 72%;
  max-height: 72%;
  object-fit: contain;
}

.detail-info {
  padding: 0 0 30px;
  border: 0;
  background: transparent;
}

.detail-chain {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  color: var(--blue);
  background: #e6efff;
  font-size: 14px;
  font-weight: 700;
}

.detail-info h2 {
  margin: 22px 0 8px;
  font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

.detail-model {
  margin: 0;
  color: var(--faint);
  font-size: 14px;
}

.notice {
  margin: 20px 0 30px;
  padding: 12px 16px;
  border: 1px solid #ffd5a3;
  border-left: 3px solid #ff9a3d;
  border-radius: 5px;
  color: #d46a21;
  background: #fff8ef;
  font-size: 14px;
  font-weight: 700;
}

.detail-price-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.detail-price {
  margin: 0;
  color: var(--orange);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: 0;
}

.detail-price span {
  color: var(--faint);
  font-size: 16px;
  font-weight: 700;
}

.detail-desc {
  margin: 56px 0 28px;
  color: #48566b;
  font-size: 16px;
  line-height: 1.8;
}

.company-panel {
  padding: 20px;
  background: #eef4ff;
  border-color: #bdd1ff;
}

.company-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 17px;
}

.company-panel h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.company-grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  row-gap: 10px;
  column-gap: 14px;
  color: #4a5669;
  font-size: 14px;
  line-height: 1.65;
}

.company-grid dt {
  color: #6f7c90;
  font-weight: 700;
}

.detail-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.primary-phone {
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  color: #263247;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
}

.back-button {
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
}

.back-top {
  position: fixed;
  right: 34px;
  bottom: 32px;
  z-index: 19;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 16px 36px rgba(37, 99, 255, 0.32);
  font-size: 20px;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.back-top:hover {
  transform: translateY(-3px);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  :root {
    --page-gutter: clamp(36px, 5vw, 72px);
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .detail-main-image {
    height: 390px;
  }

  .sort-bar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .catalog-search {
    width: 100%;
  }

  #resultCount {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .hero-inner,
  .tabs-inner,
  .layout,
  .detail-view {
    width: min(100% - 28px, var(--content-width));
  }

  .chain-tabs {
    padding: 18px 0 24px;
  }

  .chain-tab {
    min-height: 40px;
    padding: 0 14px;
  }

  .sort-bar {
    align-items: flex-start;
    padding: 18px;
  }

  .sort-options {
    flex-wrap: wrap;
  }

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

  .product-card {
    min-height: 330px;
  }

  .pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .detail-main-image {
    height: 300px;
  }

  .thumbs {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-desc {
    margin-top: 36px;
  }

  .back-top {
    right: 18px;
    bottom: 18px;
  }
}
