:root {
  --ink: #151724;
  --ink-soft: #3f4350;
  --muted: #737986;
  --paper: #f4f5f2;
  --white: #ffffff;
  --line: #dfe2dd;
  --line-strong: #c9cdc6;
  --gold: #d4af37;
  --gold-soft: #f5edcf;
  --category: #b08a1e;
  --category-soft: #f4edcf;
  --price: #b44b3f;
  --shadow: 0 16px 42px rgba(21, 23, 36, 0.12);
  --radius: 8px;
}

body[data-catalog="fiberglass"] {
  --category: #a86224;
  --category-soft: #f8eadc;
}

body[data-catalog="clear"] {
  --category: #08788d;
  --category-soft: #dff3f5;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  background: var(--ink);
  color: var(--white);
}

.header-inner,
.intro-inner,
.tab-list,
.toolbar-inner,
.catalog-main,
.site-footer-inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.72);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 600;
}

.brand-copy small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.wechat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.wechat-button:hover {
  border-color: rgba(212, 175, 55, 0.72);
  background: rgba(255, 255, 255, 0.06);
}

.wechat-button svg,
.field-icon,
.button-icon,
.icon-button svg,
.detail-label svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding: 36px 0 30px;
}

.intro-copy {
  max-width: 680px;
}

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0.18em;
}

.intro-copy h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.25;
}

.intro-copy p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.intro-note {
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.46);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.intro-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
}

.catalog-tabs {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.tab-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.56);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.tab-link + .tab-link {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.04);
}

.tab-link[aria-current="page"] {
  color: var(--white);
  background: rgba(212, 175, 55, 0.08);
}

.tab-link[aria-current="page"]::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 2px;
  background: var(--gold);
  content: "";
}

.tab-index {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
}

.tab-name {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-count {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 242, 0.94);
  backdrop-filter: blur(14px);
}

.toolbar-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.field-icon {
  position: absolute;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}

.search-input,
.select-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.search-input {
  padding: 0 13px 0 40px;
}

.select-input {
  min-width: 142px;
  padding: 0 36px 0 38px;
  cursor: pointer;
}

.search-input:focus,
.select-input:focus {
  border-color: var(--category);
  box-shadow: 0 0 0 3px var(--category-soft);
}

.result-count {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.result-count strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.catalog-main {
  padding-top: 26px;
  padding-bottom: 74px;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.product-card:hover,
.product-card:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(21, 23, 36, 0.1);
  transform: translateY(-2px);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f8f8f5;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 260ms ease;
}

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

.image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  gap: 8px;
  color: #a6aba4;
  font-size: 12px;
  text-align: center;
}

.image-placeholder svg {
  width: 28px;
  height: 28px;
  margin: 0 auto;
}

.gallery-count {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(21, 23, 36, 0.74);
  color: var(--white);
  font-size: 10px;
  backdrop-filter: blur(7px);
}

.gallery-count svg {
  width: 12px;
  height: 12px;
}

.card-body {
  display: grid;
  gap: 9px;
  padding: 12px 13px 14px;
}

.card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.product-id {
  color: var(--category);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-code {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-spec {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.material-label {
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--category-soft);
  border-radius: 4px;
  background: var(--category-soft);
  color: var(--category);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  max-width: 62%;
  color: var(--price);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.product-price.ask {
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
}

.empty-state {
  padding: 90px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: var(--line-strong);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 16px;
}

.text-button {
  margin-top: 16px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--category);
  cursor: pointer;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 94px;
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--category);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 13, 20, 0.76);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  backdrop-filter: blur(8px);
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform 180ms ease;
}

.modal.is-open .modal-panel {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.modal-close:hover {
  border-color: var(--line-strong);
}

.product-viewer {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 600px;
  background: #f7f7f4;
}

.viewer-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 34px;
}

.viewer-image {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: contain;
}

.viewer-stage .image-placeholder {
  min-height: 320px;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(21, 23, 36, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
}

.gallery-nav.prev {
  left: 14px;
}

.gallery-nav.next {
  right: 14px;
}

.gallery-nav[hidden] {
  display: none;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  min-height: 84px;
  padding: 12px 14px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.gallery-thumbs[hidden] {
  display: none;
}

.thumb-button {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  overflow: hidden;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
}

.thumb-button[aria-current="true"] {
  border-color: var(--category);
  box-shadow: 0 0 0 1px var(--category);
}

.thumb-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-details {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 42px 32px 28px;
  overflow-y: auto;
}

.detail-id {
  color: var(--category);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
}

.detail-title {
  margin: 8px 0 26px;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.3;
}

.detail-list {
  display: grid;
  gap: 18px;
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.detail-value {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: break-word;
}

.detail-price {
  color: var(--price);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.primary-button:hover {
  background: #292c3d;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--ink);
}

.privacy-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.wechat-modal {
  z-index: 90;
}

.wechat-panel {
  position: relative;
  width: min(390px, 100%);
  padding: 28px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}

.wechat-panel h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.wechat-panel p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.wechat-panel img {
  width: min(260px, 76vw);
  max-height: 330px;
  margin: 0 auto;
  border: 1px solid var(--line);
  object-fit: contain;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  }
}

@media (max-width: 720px) {
  .header-inner,
  .intro-inner,
  .tab-list,
  .toolbar-inner,
  .catalog-main,
  .site-footer-inner {
    width: min(100% - 28px, 1240px);
  }

  .header-inner {
    min-height: 62px;
  }

  .brand-copy small {
    display: none;
  }

  .wechat-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .wechat-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .intro-inner {
    display: block;
    padding: 26px 0 22px;
  }

  .intro-copy h1 {
    font-size: 27px;
  }

  .intro-copy p {
    max-width: 92%;
  }

  .intro-note {
    display: none;
  }

  .tab-list {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab-list::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0 15px;
  }

  .tab-link + .tab-link {
    border-left: 0;
  }

  .tab-count {
    margin-left: 4px;
  }

  .toolbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: auto;
    padding: 10px 0;
  }

  .toolbar .field:first-child {
    grid-column: 1 / -1;
  }

  .select-input {
    min-width: 126px;
  }

  .result-count {
    min-width: auto;
  }

  .catalog-main {
    padding-top: 16px;
    padding-bottom: 54px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-media {
    aspect-ratio: 4 / 5;
  }

  .card-body {
    gap: 7px;
    padding: 10px 10px 12px;
  }

  .product-spec {
    min-height: 36px;
    font-size: 11px;
  }

  .material-label {
    max-width: 72px;
    padding: 3px 5px;
    font-size: 9px;
  }

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

  .site-footer-inner {
    display: grid;
    gap: 12px;
    padding: 22px 0;
  }

  .modal {
    padding: 0;
  }

  .modal-panel {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow-y: auto;
    border: 0;
    border-radius: 0;
  }

  .product-viewer {
    min-height: 0;
  }

  .viewer-stage {
    height: min(52vh, 440px);
    padding: 24px;
  }

  .viewer-image {
    max-height: 100%;
  }

  .product-details {
    min-height: 48vh;
    padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .detail-title {
    margin-bottom: 20px;
    font-size: 22px;
  }

  .detail-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .detail-actions {
    margin-top: 12px;
  }

  .modal-close {
    position: fixed;
    top: 12px;
    right: 12px;
  }

  .wechat-panel {
    margin: 14px;
  }
}

@media (max-width: 340px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .card-media {
    aspect-ratio: 1 / 1;
  }

  .tab-name {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
