@font-face {
  font-family: "MaShanZheng";
  src: url("assets/MaShanZheng-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --primary: #8a2e2a;
  --primary-dark: #5e211f;
  --wood: #755542;
  --cream: #fff9ef;
  --paper: #f5efe5;
  --ink: #2d2926;
  --muted: #716962;
  --line: #dfd2c2;
  --gold: #c58b3d;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(197, 139, 61, 0.1), transparent 26rem),
    var(--paper);
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  max-width: 100%;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

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

.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;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(117, 85, 66, 0.18);
  background: rgba(255, 249, 239, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1180px;
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-tiger {
  font-size: 36px;
  line-height: 1;
}

.brand-name,
h1,
h2 {
  font-family: "MaShanZheng", "STKaiti", "KaiTi", serif;
  font-weight: 400;
}

.brand-name {
  font-size: 29px;
  letter-spacing: 2px;
}

.readonly-badge {
  padding: 7px 13px;
  border: 1px solid #8bbf83;
  border-radius: 999px;
  color: #2e6b31;
  background: #eff9ed;
  font-size: 15px;
  font-weight: 700;
}

.hero {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 48px 28px;
  overflow: hidden;
  position: relative;
  border-radius: 28px;
  color: white;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(92, 31, 29, 0.96), rgba(117, 85, 66, 0.92)),
    url("assets/item1.jpg") center 48% / cover;
  box-shadow: 0 18px 48px rgba(69, 42, 32, 0.2);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.hero::before {
  width: 260px;
  height: 260px;
  left: -130px;
  top: -160px;
}

.hero::after {
  width: 360px;
  height: 360px;
  right: -190px;
  bottom: -270px;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-mark {
  font-size: 68px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.eyebrow {
  margin: 10px 0 3px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f2c987;
}

h1 {
  margin: 5px 0 8px;
  font-size: clamp(42px, 7vw, 68px);
  letter-spacing: 0.08em;
}

.hero-copy {
  max-width: 650px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.75;
}

.preview-note {
  width: fit-content;
  max-width: 100%;
  margin: 24px auto 0;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff8e8;
  background: rgba(35, 20, 16, 0.35);
  font-size: 15px;
}

.visitor-info {
  width: min(760px, 100%);
  margin: 22px auto 0;
  padding: 17px 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  color: #fff9ec;
  background: rgba(35, 20, 16, 0.46);
  box-shadow: 0 8px 24px rgba(30, 14, 11, 0.16);
  line-height: 1.7;
  backdrop-filter: blur(4px);
}

.visitor-info p {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.visitor-info-title {
  color: #f7d69c;
  font-family: "MaShanZheng", "STKaiti", "KaiTi", serif;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.contact-id {
  display: inline-block;
  color: white;
  font-size: 19px;
  letter-spacing: 0.04em;
  user-select: all;
}

.catalog-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 24px 70px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading .eyebrow {
  margin-top: 0;
}

h2 {
  margin: 0;
  font-size: 40px;
  letter-spacing: 0.06em;
}

.result-count {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 16px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 249, 239, 0.84);
}

.search-box {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: none;
}

.search-icon {
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
}

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

.type-filters {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--wood);
  background: white;
  cursor: pointer;
  font-weight: 700;
}

.filter-button:hover,
.filter-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-button.active {
  border-color: var(--primary);
  color: white;
  background: var(--primary);
}

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

.product-card {
  overflow: hidden;
  border: 1px solid rgba(117, 85, 66, 0.16);
  border-radius: 22px;
  background: var(--cream);
  box-shadow: 0 9px 28px rgba(67, 45, 34, 0.1);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  min-width: 0;
}

.product-card:hover,
.product-card:focus-visible {
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 15px 36px rgba(67, 45, 34, 0.18);
}

.card-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  background: #ded4c8;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease;
}

.no-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 210px;
  padding: 20px;
  background: linear-gradient(145deg, #eee4d4, #d7c5ae);
  color: #684d3d;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.detail-no-image {
  min-height: 320px;
}

.no-image[hidden] {
  display: none;
}

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

.sample-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: white;
  background: rgba(94, 33, 31, 0.88);
  font-size: 13px;
  font-weight: 700;
}

.card-content {
  padding: 17px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  margin: 2px 0 0;
  font-size: 21px;
  line-height: 1.35;
}

.type-label {
  flex: 0 0 auto;
  display: inline-block;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--primary);
  background: #f7e6df;
  font-size: 14px;
  font-weight: 800;
}

.card-notes {
  min-height: 49px;
  margin: 11px 0 13px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword {
  padding: 5px 9px;
  border-radius: 999px;
  color: #6a4b37;
  background: #eee3d3;
  font-size: 13px;
}

.card-footer,
.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.wanted {
  color: #aa3732;
  font-size: 16px;
  font-weight: 800;
}

.view-detail {
  color: var(--primary);
  font-weight: 800;
}

.empty-state {
  padding: 70px 20px;
  border: 1px dashed #cdbca9;
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 249, 239, 0.68);
}

.empty-state span {
  font-size: 52px;
}

.empty-state h3 {
  margin: 10px 0 4px;
  font-size: 23px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

footer {
  padding: 35px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  background: #eee5d8;
}

footer p {
  margin: 5px 0;
}

footer .developer {
  color: var(--wood);
  font-family: "MaShanZheng", "STKaiti", serif;
  font-size: 18px;
  letter-spacing: 1px;
}

footer .icp-record a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

footer .icp-record a:hover,
footer .icp-record a:focus-visible {
  color: var(--wood);
  text-decoration: underline;
}

.detail-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.detail-dialog::backdrop {
  background: rgba(31, 22, 18, 0.68);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: white;
  background: rgba(41, 27, 22, 0.76);
  cursor: pointer;
  font-size: 31px;
  line-height: 1;
}

.detail-gallery-shell {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  background: #2f2520;
}

.detail-gallery-shell.single-image {
  grid-template-columns: minmax(0, 1fr);
}

.detail-gallery-shell.single-image .detail-image-stage {
  grid-column: 1;
}

.detail-image-stage {
  height: 430px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background: #ded4c8;
  touch-action: pan-y;
}

.detail-image-stage > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #2f2520;
}

.detail-image-stage .detail-no-image {
  height: 100%;
  min-height: 0;
}

.detail-image-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  color: white;
  background: rgba(47, 30, 24, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.gallery-arrow {
  width: 44px;
  height: 58px;
  margin: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 38px;
  line-height: 1;
}

.gallery-arrow:hover,
.gallery-arrow:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}

.detail-thumbnails {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 12px 16px 6px;
  background: #2f2520;
  scrollbar-width: thin;
}

.detail-thumbnail {
  flex: 0 0 auto;
  width: 72px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 9px;
  background: #ded4c8;
  cursor: pointer;
}

.detail-thumbnail.active {
  border-color: #f2c987;
}

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

.detail-gallery-hint {
  margin: 0;
  padding: 6px 16px 10px;
  color: #f8dfb7;
  background: #2f2520;
  font-size: 14px;
  text-align: center;
}

.gallery-arrow[hidden],
.detail-thumbnails[hidden],
.detail-gallery-hint[hidden] {
  display: none;
}

.dialog-content {
  padding: 24px 26px 27px;
}

.dialog-content h2 {
  margin: 8px 0 10px;
}

.detail-notes {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.detail-meta {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 880px) {
  .hero {
    margin-inline: 18px;
  }

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

  .type-filters {
    justify-content: flex-start;
  }

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

@media (max-width: 580px) {
  .header-inner {
    min-height: 64px;
    padding-inline: 15px;
  }

  .brand-tiger {
    font-size: 30px;
  }

  .brand-name {
    overflow: hidden;
    font-size: 22px;
    letter-spacing: 1px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .readonly-badge {
    padding: 5px 8px;
    font-size: 12px;
  }

  .hero {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    margin: 14px 12px 0;
    padding: 34px 18px;
    border-radius: 22px;
  }

  .hero-mark {
    font-size: 56px;
  }

  h1 {
    max-width: 100%;
    font-size: 39px;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
  }

  .hero-copy {
    max-width: 100%;
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  .preview-note {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .visitor-info {
    margin-top: 16px;
    padding: 15px 13px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.65;
  }

  .visitor-info-title {
    font-size: 21px;
  }

  .contact-id {
    font-size: 17px;
  }

  .catalog-section {
    padding: 40px 12px 54px;
  }

  .section-heading {
    display: block;
    margin-inline: 3px;
  }

  h2 {
    font-size: 34px;
  }

  .result-count {
    margin-top: 5px;
    white-space: nowrap;
  }

  .controls {
    width: 100%;
    min-width: 0;
    padding: 11px;
    border-radius: 17px;
  }

  .search-box,
  .type-filters {
    width: 100%;
    min-width: 0;
  }

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

  .card-image-wrap {
    aspect-ratio: 16 / 11;
  }

  .detail-gallery-shell {
    grid-template-columns: 43px minmax(0, 1fr) 43px;
  }

  .detail-image-stage {
    height: 44vh;
    min-height: 270px;
    max-height: 430px;
  }

  .gallery-arrow {
    width: 36px;
    height: 52px;
    margin: 3px;
    border-radius: 11px;
    font-size: 32px;
  }

  .detail-thumbnails {
    padding-inline: 10px;
  }

  .dialog-content {
    padding: 21px 19px 24px;
  }
}
