:root {
  --bg: #f4f5f7;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-solid: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --primary: #f97316;
  --primary-dark: #c2410c;
  --accent: #2563eb;
  --line: #e5e7eb;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 16% -10%, rgba(249, 115, 22, 0.16), transparent 28%),
    linear-gradient(180deg, #fff7ed 0, var(--bg) 210px, var(--bg) 100%);
}

body.has-front-bg {
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.76), rgba(244, 245, 247, 0.86)),
    var(--front-bg-image) center / cover fixed no-repeat,
    var(--bg);
}

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

button,
a,
select {
  cursor: pointer;
}

.notice {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 10px 14px;
  text-align: center;
  color: #9a3412;
  background: rgba(255, 247, 237, 0.96);
  border-bottom: 1px solid rgba(249, 115, 22, 0.14);
  backdrop-filter: blur(12px);
  font-size: 15px;
  font-weight: 800;
}

.notice a {
  color: #9a3412;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.access-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 12% 8%, rgba(249, 115, 22, 0.22), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.1), transparent 24%),
    linear-gradient(160deg, #fff7ed 0, #f4f5f7 62%, #eef2f7 100%);
}

body.has-front-bg .access-gate {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.5)),
    var(--front-bg-image) center / cover no-repeat;
}

.access-card {
  width: min(390px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid rgba(249, 115, 22, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
}

.access-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.access-card h1 {
  font-size: clamp(28px, 9vw, 42px);
  line-height: 1.05;
}

.access-copy {
  margin: -4px 0 6px;
  color: var(--muted);
  line-height: 1.65;
}

.access-card input {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
}

.access-message {
  min-height: 22px;
  margin: 0;
  color: var(--primary-dark);
  text-align: center;
  font-weight: 800;
}

.site-shell {
  width: min(1120px, calc(100% - 16px));
  margin: 10px auto 36px;
}

.mobile-control-panel {
  position: relative;
  z-index: 20;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 0.95;
}

.hero-copy {
  margin: 12px 0 0;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px;
}

.search-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(229, 231, 235, 0.96);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 138, 36, 0.18);
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 9px 14px;
  font-weight: 800;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
}

.btn-ghost {
  color: #333;
  background: #fff;
  border: 1px solid var(--line);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}

.filter-card {
  padding: 0;
}

.filter-card.active select {
  border-color: rgba(249, 115, 22, 0.42);
  color: #9a3412;
  background: #fff7ed;
  font-weight: 900;
}

.filter-card.disabled {
  opacity: 0.58;
}

.filter-card.disabled select {
  cursor: not-allowed;
}

.filter-card label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.filter-card select {
  min-height: 42px;
  border: 0;
  color: #222;
  background: transparent;
  font-size: 18px;
  text-align: center;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 10px;
  background: var(--panel-solid);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  border-color: #bdbdbd;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.image-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1.18;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #efefef;
}

.image-mosaic {
  display: grid;
  gap: 2px;
}

.image-mosaic.count-0 {
  display: grid;
  place-items: center;
}

.image-mosaic.count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.image-mosaic.count-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

.image-mosaic.count-3 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.image-mosaic.count-3 .cell-1 {
  grid-row: 1 / span 2;
}

.image-mosaic.count-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.mosaic-cell {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e8e8e8;
}

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

.empty-image {
  color: #888;
  font-size: 13px;
  font-weight: 800;
}

.product-info {
  padding: 9px 10px 10px;
}

.serial {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  color: #333;
  background: #f2f2f2;
  font-size: 12px;
  font-weight: 900;
}

.big-serial {
  margin-bottom: 5px;
  color: #1f1f1f;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.body-line {
  margin-bottom: 4px;
  color: #333;
  font-size: 14px;
  font-weight: 800;
}

.tag-line {
  margin-bottom: 5px;
  color: #1f1f1f;
  font-size: 13px;
  font-weight: 800;
  word-break: break-word;
}

.description {
  display: -webkit-box;
  min-height: 36px;
  margin: 0 0 7px;
  overflow: hidden;
  color: #444;
  font-size: 12px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bottom-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
  color: #333;
  font-size: 17px;
  font-weight: 700;
}

.bottom-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verify-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  color: #166534;
  background: #dcfce7;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 800;
}

.verify-badge.busy {
  color: #c22727;
  background: transparent;
}

.verify-badge.center {
  color: #27a36a;
  background: transparent;
}

.card-detail {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
  color: #8a8a8a;
  font-size: 15px;
  line-height: 1.2;
}

.right-detail {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 0;
  text-align: right;
}

.plain-status {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plain-status.busy {
  color: #d33636;
}

.plain-status.verified,
.plain-status.center {
  color: #3ca96f;
}

.status-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.status-chip,
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #555;
  background: #f2f2f2;
  white-space: nowrap;
}

.status-chip.verified {
  color: #137a36;
  background: #e4f7e9;
}

.status-chip.busy {
  color: #b91c1c;
  background: #fee2e2;
}

.status-chip.center {
  color: #1d4ed8;
  background: #dbeafe;
}

.code-chip {
  color: #666;
  background: #f5f5f5;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px;
  border: 1px dashed #c9c9c9;
  border-radius: var(--radius-lg);
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

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

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

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
    background:
      radial-gradient(circle at 14% -4%, rgba(249, 115, 22, 0.18), transparent 30%),
      linear-gradient(180deg, #fff7ed 0, #f5f6f8 170px, #f5f6f8 100%);
  }

  .notice {
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .access-gate {
    align-items: start;
    padding: calc(58px + env(safe-area-inset-top)) 14px 18px;
  }

  .access-card {
    gap: 12px;
    padding: 24px 18px;
    border-radius: 20px;
  }

  .access-card input {
    min-height: 52px;
  }

  .site-shell {
    width: 100%;
    margin-top: 0;
    padding: 0 6px calc(22px + env(safe-area-inset-bottom));
  }

  .mobile-control-panel {
    position: sticky;
    top: calc(34px + env(safe-area-inset-top));
    z-index: 30;
    margin: 0 -6px 8px;
    padding: 7px 6px 6px;
    background: rgba(245, 246, 248, 0.92);
    border-bottom: 1px solid rgba(229, 231, 235, 0.78);
    backdrop-filter: blur(14px);
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 0 0 8px;
  }

  .search-form {
    gap: 6px;
    min-width: 0;
  }

  input,
  select,
  textarea,
  .btn {
    min-height: 44px;
  }

  .search-form input {
    min-width: 0;
    padding-left: 14px;
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  }

  .search-form .btn-primary {
    flex: 0 0 auto;
    padding-inline: 16px;
  }

  #homeBtn {
    padding-inline: 12px;
  }

  .filters-grid {
    display: flex;
    gap: 8px;
    margin: 0 -6px 6px;
    padding: 0 6px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .filters-grid::-webkit-scrollbar {
    display: none;
  }

  .filter-card {
    flex: 0 0 auto;
    width: 108px;
    scroll-snap-align: start;
  }

  .filter-card select {
    min-height: 44px;
    padding: 0 24px 0 8px;
    border: 1px solid #ececec;
    border-radius: 999px;
    background: #fff;
    font-size: 15px;
    text-align: left;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  }

  .status-line {
    min-height: 18px;
    padding: 0 2px;
    font-size: 12px;
  }

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

  .btn {
    padding: 9px 12px;
  }

  .image-stage {
    aspect-ratio: 1 / 1.08;
  }

  .image-mosaic {
    gap: 1px;
  }

  .product-info {
    padding: 7px 7px 8px;
  }

  .body-line {
    margin-bottom: 3px;
    font-size: 12px;
  }

  .tag-line {
    margin-bottom: 4px;
    font-size: 11.5px;
    line-height: 1.25;
  }

  .description {
    min-height: 31px;
    margin-bottom: 6px;
    font-size: 11px;
    line-height: 1.4;
  }

  .bottom-line {
    flex-direction: row;
    align-items: flex-end;
    gap: 5px;
    font-size: 14px;
    line-height: 1.2;
  }

  .bottom-name {
    max-width: 68%;
  }

  .verify-badge {
    padding: 2px 4px;
    font-size: 13px;
  }

  .card-detail {
    margin-top: 7px;
    gap: 4px;
    font-size: 12px;
  }

  .right-detail {
    gap: 2px;
    max-width: 62%;
  }

  .empty-state {
    margin: 10px 6px;
    padding: 34px 18px;
  }
}

@media (max-width: 380px) {
  .filter-card {
    width: 100px;
  }

  .bottom-line {
    font-size: 13px;
  }

  .verify-badge {
    font-size: 12px;
  }

  .card-detail {
    font-size: 11.5px;
  }
}

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