:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --text: #25211c;
  --muted: #72675d;
  --brand: #e07a3f;
  --brand-dark: #b65324;
  --border: #eadfd1;
  --shadow: 0 18px 45px rgba(82, 54, 32, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(224, 122, 63, 0.18), transparent 32rem),
    var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 56px 0 36px;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.05;
}

.site-description,
.category-description {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.contact-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: auto;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.contact-link:hover {
  border-color: rgba(224, 122, 63, 0.45);
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 16px 35px rgba(82, 54, 32, 0.12);
  transform: translateY(-2px);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 56px;
}

.sidebar,
.content {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.sidebar-title {
  margin: 4px 6px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: 10px;
}

.category-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  background: #fbf6ef;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.category-button:hover,
.category-button[aria-pressed="true"] {
  border-color: rgba(224, 122, 63, 0.45);
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  transform: translateY(-1px);
}

.content {
  min-height: 560px;
  padding: 28px;
}

.content-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.content-heading h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 38px);
}

.product-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--brand-dark);
  background: #fff0e6;
  font-size: 14px;
  font-weight: 700;
}

.product-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-top: 22px;
  padding: 0 12px;
  background: #fffaf4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-search:focus-within {
  border-color: rgba(224, 122, 63, 0.7);
  box-shadow: 0 0 0 4px rgba(224, 122, 63, 0.12);
}

.search-icon {
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1;
}

.product-search input {
  width: 100%;
  border: 0;
  padding: 14px 0;
  color: var(--text);
  background: transparent;
  outline: 0;
}

.product-search input[type="search"]::-webkit-search-cancel-button {
  appearance: none;
}

.product-search button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.product-search button:hover {
  color: var(--brand-dark);
  background: #fff0e6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fffaf4;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.product-card:hover {
  box-shadow: 0 16px 35px rgba(82, 54, 32, 0.12);
  transform: translateY(-3px);
}

.product-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1e4d7;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-details {
  padding: 16px;
}

.product-code {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  margin: 0 0 10px;
  padding: 5px 10px;
  color: var(--brand-dark);
  background: #fff0e6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.product-category-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.product-name {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.product-detail-modal[hidden] {
  display: none;
}

.product-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.product-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 33, 28, 0.58);
}

.product-detail-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  grid-template-rows: auto 1fr;
  gap: 0 28px;
  width: min(1080px, 100%);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 14px 28px 28px;
  background: #fffaf4;
  box-shadow: 0 28px 70px rgba(37, 33, 28, 0.28);
}

.product-detail-close {
  position: sticky;
  top: 0;
  grid-column: 1 / -1;
  justify-self: end;
  z-index: 2;
  width: 38px;
  height: 38px;
  margin-bottom: -6px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 250, 244, 0.94);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.product-detail-gallery,
.product-detail-content {
  overflow-y: auto;
  min-height: 0;
  padding-top: 6px;
}

.product-detail-main-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 20px;
  background: #f1e4d7;
}

.product-detail-main-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.product-detail-main-image-wrap img.is-loading {
  visibility: hidden;
}

.product-detail-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-top: 12px;
}

.product-detail-thumbnail {
  flex: 0 0 74px;
  width: 74px;
  height: 58px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 0;
  background: #f1e4d7;
  cursor: pointer;
}

.product-detail-thumbnail[aria-pressed="true"] {
  border-color: var(--brand);
}

.product-detail-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 10px 10px 0;
}

.product-detail-category {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.product-detail-code {
  border-radius: 999px;
  margin: 0 0 14px;
  padding: 6px 11px;
  color: var(--brand-dark);
  background: #fff0e6;
  font-size: 13px;
  font-weight: 800;
}

.product-detail-content h2 {
  margin-bottom: 18px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.product-detail-specifications {
  width: 100%;
}

.product-detail-specifications dl {
  display: grid;
  grid-template-columns: minmax(94px, 0.38fr) 1fr;
  gap: 10px 14px;
  margin: 0 0 22px;
}

.product-detail-specifications dt {
  color: var(--muted);
  font-weight: 800;
}

.product-detail-specifications dd {
  margin: 0;
  line-height: 1.5;
}

.product-detail-description {
  width: 100%;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 28px;
  color: var(--muted);
  background: #fffaf4;
  text-align: center;
}

.site-footer {
  padding: 26px 0 36px;
  color: var(--muted);
  text-align: center;
}

.footer-separator {
  margin: 0 8px;
  color: var(--border);
}

.visitor-count {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
  .site-header {
    padding-top: 36px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

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

  .sidebar {
    position: static;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-heading {
    display: block;
  }

  .product-count {
    display: inline-block;
    margin-top: 12px;
  }

  .product-detail-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 0 18px;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 14px 18px 18px;
  }

  .product-detail-content {
    padding: 0;
  }

  .product-detail-gallery,
  .product-detail-content {
    padding-top: 4px;
  }
}

@media (max-width: 480px) {
  .category-list {
    grid-template-columns: 1fr;
  }

  .contact-link {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .content,
  .sidebar {
    border-radius: 22px;
    padding: 18px;
  }
}