:root {
  color-scheme: light;
  --bg: #eef1f4;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #17181c;
  --muted: #66707c;
  --line: #d8dee6;
  --line-strong: #c2cad5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --wine: #7f1d1d;
  --gold: #b8892f;
  --soft: #e9f5f3;
  --card: #ffffff;
  --shadow: 0 22px 70px rgba(22, 28, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(184, 137, 47, 0.12) 44%, rgba(127, 29, 29, 0.1)),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 48%, #e7ecef 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 54px;
}

.hero-panel {
  position: relative;
  z-index: 1;
  padding: 22px;
  border: 1px solid rgba(216, 222, 230, 0.86);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-line,
.title-row,
.search-row,
.result-summary,
.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.credit,
.updated,
.filter-label,
.dataset-name,
.eyebrow,
.first-date,
.detail-subtitle {
  margin: 0;
  color: var(--muted);
}

.credit {
  color: var(--wine);
  font-size: 14px;
  font-weight: 800;
}

.updated {
  font-size: 13px;
}

.filter-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.filter-button.active {
  border-color: rgba(15, 118, 110, 0.22);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.2);
}

.title-row {
  align-items: flex-end;
  margin-top: 22px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(30px, 4.25vw, 50px);
  line-height: 1.02;
  letter-spacing: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stats span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.search-row {
  margin-top: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.search-icon {
  width: 48px;
  text-align: center;
  color: var(--accent-dark);
  font-size: 24px;
}

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

.icon-button,
.dialog-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}

.icon-button {
  width: 52px;
  height: 52px;
  font-size: 28px;
}

.filter-block {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(260px, 0.65fr);
  gap: 14px 18px;
  margin-top: 16px;
}

.filter-block > div {
  min-width: 0;
}

.filter-block > div:first-child {
  grid-column: 1 / -1;
}

.filter-label {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}

.filter-row {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 2px;
}

.filter-button {
  flex: 0 0 auto;
  min-width: max(58px, calc(var(--label-chars, 2) * 1em + 34px));
  width: max-content;
  max-width: none;
  min-height: 40px;
  padding: 7px 13px;
  border-color: var(--line);
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.result-summary {
  min-height: 52px;
  color: var(--muted);
  font-size: 14px;
}

.summary-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sort-control select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 0 10px;
}

#match-count {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  align-items: center;
  height: 234px;
  min-height: 234px;
  border: 1px solid rgba(216, 222, 230, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(22, 28, 38, 0.08);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(22, 28, 38, 0.14);
}

.card-action {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.product-card > *:not(.card-action) {
  position: relative;
  pointer-events: none;
}

.product-image-wrap {
  display: grid;
  place-items: center;
  width: 152px;
  height: 203px;
  align-self: center;
  margin: 14px 0 14px 14px;
  padding: 10px;
  border: 1px solid rgba(216, 222, 230, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(184, 137, 47, 0.1)),
    #f6f7f8;
  overflow: hidden;
}

.product-image,
#detail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.product-body {
  display: flex;
  min-width: 0;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
}

.dataset-name {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.product-name {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.first-date {
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
}

.product-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.tag {
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.3;
}

.field-item {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.field-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field-value {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.field-value span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.grade-icon {
  width: 34px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
}

.timeline {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.timeline-title {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.return-empty {
  color: var(--muted);
  font-size: 13px;
}

.stats-link {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.stats-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 22px;
}

.stats-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stats-controls input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.stats-controls button {
  align-self: end;
  min-width: 92px;
}

.stats-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stats-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.stats-table th {
  color: var(--accent-dark);
  background: var(--soft);
}

.stats-table td {
  color: var(--muted);
}

.card-xishi .timeline,
.card-chaofan .timeline {
  margin-top: 12px;
}

.date-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  min-height: 36px;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f7f9fa;
}

.date-row.matched {
  background: var(--soft);
  outline: 1px solid rgba(15, 118, 110, 0.26);
}

.date-type {
  color: var(--accent-dark);
  font-weight: 900;
}

.date-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
}

.prediction-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-bottom: 0;
  padding: 2px 6px;
  border-radius: 999px;
  color: #7f1d1d;
  background: #fff1f2;
  font-size: 11px;
  font-weight: 900;
}

.empty-state {
  margin-top: 24px;
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.68);
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

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

.detail-dialog {
  width: min(980px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  font-size: 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(300px, 43%) 1fr;
  max-height: min(820px, calc(100dvh - 28px));
  overflow: hidden;
}

.detail-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  margin: 0;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(184, 137, 47, 0.12)),
    #f2f5f6;
  overflow: hidden;
  touch-action: pan-y;
}

.detail-image-wrap #detail-image {
  width: auto;
  height: auto;
  max-width: min(72%, 340px);
  max-height: min(76vh, 560px);
  border-radius: 6px;
}

.gallery-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 54px;
  transform: translateY(-50%);
  border: 1px solid rgba(216, 222, 230, 0.9);
  border-radius: 8px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(22, 28, 38, 0.12);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

.gallery-counter {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.detail-content {
  padding: 30px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

#detail-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.12;
}

.detail-subtitle {
  margin-top: 8px;
}

.detail-products {
  margin-top: 16px;
}

.detail-section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.detail-product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
  gap: 8px;
}

.detail-product-chip {
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.detail-product-chip.active {
  border-color: rgba(15, 118, 110, 0.3);
  color: #fff;
  background: var(--accent);
}

.detail-record-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.detail-record-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

mark {
  padding: 0 2px;
  border-radius: 4px;
  color: inherit;
  background: rgba(184, 137, 47, 0.22);
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .hero-panel {
    padding: 16px;
  }

  .top-line,
  .title-row,
  .search-row,
  .result-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-tools {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .sort-control {
    justify-content: space-between;
  }

  .stats {
    justify-content: flex-start;
  }

  .filter-block {
    grid-template-columns: 1fr;
  }

  .filter-block > div:first-child {
    grid-column: auto;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .icon-button {
    width: 100%;
  }

  .detail-layout {
    display: block;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-image-wrap {
    height: min(58vh, 420px);
    min-height: auto;
    aspect-ratio: auto;
    padding: 10px 52px 28px;
  }

  .detail-image-wrap #detail-image {
    width: auto !important;
    height: min(46vh, 320px) !important;
    max-width: min(94%, 520px);
    max-height: min(46vh, 320px);
    object-fit: contain;
  }

  .detail-content {
    padding: 22px;
    overflow: visible;
  }

  .detail-dialog {
    max-height: calc(100dvh - 96px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 720px) {
  .results {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-card {
    grid-template-columns: 118px minmax(0, 1fr);
    height: 158px;
    min-height: 0;
  }

  .product-image-wrap {
    width: 102px;
    height: 132px;
    margin: 13px 0 13px 12px;
    padding: 6px;
  }

  .product-body {
    min-height: 0;
    padding: 10px 10px 10px 8px;
  }

  .product-name {
    font-size: clamp(16px, 5vw, 20px);
    line-height: 1.15;
  }

  .dataset-name {
    margin-bottom: 2px;
    font-size: 11px;
  }

  .first-date {
    margin-top: 4px;
  }

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

  .product-card .field-item {
    min-height: 32px;
    padding: 5px 6px;
  }

  .product-card .field-label {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .product-card .field-value {
    gap: 3px;
    font-size: 11px;
  }

  .product-card .grade-icon {
    width: 24px;
    height: 16px;
  }

  .product-card .field-item:nth-child(n + 3),
  .product-card .timeline {
    display: none;
  }

  .date-row {
    grid-template-columns: 46px 1fr;
    gap: 8px;
    padding: 8px;
  }
}

@media (max-width: 520px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: min(100% - 18px, 1220px);
    padding-bottom: 80px;
  }

  h1 {
    font-size: clamp(27px, 8.7vw, 38px);
  }

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

  .field-item {
    padding: 7px;
  }

  .field-value {
    gap: 4px;
    font-size: 12px;
  }

  .product-card {
    grid-template-columns: 106px minmax(0, 1fr);
    height: 148px;
  }

  .product-image-wrap {
    width: 92px;
    height: 124px;
    margin: 12px 0 12px 10px;
  }

  .first-date,
  .timeline-title,
  .date-row,
  .tag {
    font-size: 12px;
  }

  .date-value {
    word-break: break-word;
  }

  .dialog-close {
    top: 10px;
    right: 10px;
  }

  .detail-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 72px);
  }

  .detail-content {
    padding: 14px;
  }

  .detail-image-wrap {
    height: min(48vh, 320px);
    padding: 8px 42px 24px;
  }

  .detail-image-wrap #detail-image {
    width: auto !important;
    height: min(40vh, 280px) !important;
    max-width: min(94%, 430px);
    max-height: min(40vh, 280px);
    object-fit: contain;
  }

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

  .detail-product-chip {
    min-height: 40px;
    padding: 8px 9px;
  }
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(70, 132, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #f4f8ff 0%, #eef5ff 34%, #ffffff 76%);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  padding-top: 18px;
}

.hero-panel {
  min-height: 420px;
  padding: 34px;
  border: 0;
  border-radius: 26px;
  color: #fff;
  background-image:
    linear-gradient(90deg, rgba(12, 37, 92, 0.88) 0%, rgba(23, 62, 130, 0.52) 35%, rgba(11, 32, 72, 0.08) 62%),
    linear-gradient(180deg, rgba(11, 32, 72, 0.02), rgba(11, 32, 72, 0.16)),
    url("./assets/home-banner.jpg");
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  box-shadow: 0 26px 70px rgba(23, 80, 171, 0.24);
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 86px;
  background: linear-gradient(180deg, transparent, rgba(246, 250, 255, 0.72));
  pointer-events: none;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 6% 20%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 16% 33%, rgba(255, 255, 255, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 13%, rgba(255, 255, 255, 0.62) 0 1px, transparent 2px);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(620px, 58%);
}

.credit {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 30px;
  padding: 0 17px;
  border-radius: 999px;
  color: #2d6fe9;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(107, 150, 229, 0.28);
  font-size: 15px;
  font-weight: 900;
}

.credit::before {
  content: "✦";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  color: #fff;
  background: #5c8df8;
  font-size: 13px;
}

h1 {
  max-width: 560px;
  color: #f8fbff;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.12;
  text-shadow: 0 4px 18px rgba(2, 18, 49, 0.36);
}

.hero-subtitle {
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(18px, 2.15vw, 25px);
  font-weight: 800;
  line-height: 1.65;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 34px;
  padding: 18px 16px;
  border: 1px solid rgba(206, 225, 255, 0.5);
  border-radius: 22px;
  background: rgba(57, 92, 151, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
}

.stats span {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 70px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid rgba(218, 231, 255, 0.26);
  border-radius: 0;
  color: #fff;
  background: transparent;
  white-space: normal;
}

.stats span:last-child {
  border-right: 0;
}

.stat-card::before {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 52px;
  height: 52px;
  align-self: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(113, 165, 255, 0.78), rgba(67, 123, 221, 0.48));
  box-shadow: inset 0 0 0 1px rgba(204, 225, 255, 0.36);
  font-size: 25px;
}

.stat-product::before {
  content: "♕";
}

.stat-record::before {
  content: "▦";
  color: #ffb45e;
}

.stat-image::before {
  content: "▧";
  color: #78d8ff;
}

.stats b {
  align-self: end;
  color: #fff;
  font-size: 31px;
  line-height: 1;
}

.stats em {
  align-self: start;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-style: normal;
  font-weight: 800;
}

.updated {
  width: min(1080px, calc(100% - 42px));
  margin: 18px auto 0;
  color: #6f7890;
  font-size: 16px;
  font-weight: 700;
}

.updated::before {
  content: "◷";
  margin-right: 8px;
  color: #7d879d;
}

.control-panel {
  display: grid;
  gap: 14px;
  width: min(1080px, calc(100% - 42px));
  margin: 22px auto 0;
}

.search-row {
  min-height: 84px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(214, 224, 241, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 42px rgba(54, 95, 156, 0.12);
}

.search-box {
  min-height: 56px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.search-icon {
  width: 64px;
  color: #717b96;
  font-size: 38px;
}

#search-input {
  height: 56px;
  color: #202636;
  font-size: 20px;
  font-weight: 700;
}

#search-input::placeholder {
  color: #7f879f;
}

.search-button {
  flex: 0 0 auto;
  min-width: 132px;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #6aa2ff, #1d66df);
  box-shadow: 0 10px 22px rgba(32, 105, 225, 0.25);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}

.filter-shell {
  border: 1px solid rgba(214, 224, 241, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(54, 95, 156, 0.09);
  overflow: hidden;
}

.filter-shell summary {
  display: grid;
  grid-template-columns: minmax(116px, auto) repeat(3, minmax(122px, 1fr)) 20px;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 12px 24px;
  list-style: none;
  cursor: pointer;
}

.filter-shell summary::-webkit-details-marker {
  display: none;
}

.filter-summary-title {
  color: #176ae6;
  font-size: 18px;
  font-weight: 900;
}

.filter-summary-title::before {
  content: "▽";
  margin-right: 10px;
  color: #176ae6;
}

.filter-chip {
  display: inline-flex;
  justify-content: center;
  min-height: 42px;
  align-items: center;
  border: 1px solid rgba(216, 226, 242, 0.95);
  border-radius: 999px;
  color: #252b3a;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.filter-chip::after {
  content: "⌄";
  margin-left: 8px;
  color: #176ae6;
}

.filter-caret {
  color: #717b96;
  font-size: 22px;
  transition: transform 160ms ease;
}

.filter-shell[open] .filter-caret {
  transform: rotate(180deg);
}

.filter-block {
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0 22px 20px;
}

.filter-block > div:first-child {
  grid-column: 1 / -1;
}

.filter-button {
  border-radius: 999px;
}

.filter-button.active {
  background: linear-gradient(135deg, #6aa2ff, #1d66df);
  box-shadow: 0 10px 24px rgba(32, 105, 225, 0.18);
}

.result-summary {
  width: min(1080px, calc(100% - 42px));
  min-height: 78px;
  margin: 18px auto 0;
  padding: 0 32px;
  border: 1px solid rgba(214, 224, 241, 0.86);
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(54, 95, 156, 0.08);
}

#match-count {
  color: #0e5bd9;
  font-size: 30px;
}

.sort-control {
  color: #6f7890;
  font-size: 17px;
  font-weight: 800;
}

.sort-control select {
  border: 0;
  color: #176ae6;
  background: transparent;
  font-size: 17px;
}

.results {
  width: min(1080px, calc(100% - 42px));
  margin: 0 auto;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0 32px 22px;
  border: 1px solid rgba(214, 224, 241, 0.86);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(54, 95, 156, 0.1);
}

.product-card {
  grid-template-columns: 180px minmax(0, 1fr) 22px;
  height: auto;
  min-height: 218px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.product-card::after {
  content: "›";
  align-self: center;
  color: #7c8499;
  font-size: 42px;
}

.product-card:hover {
  transform: none;
  box-shadow: none;
}

.product-image-wrap {
  width: 150px;
  height: 150px;
  margin: 22px 0;
  padding: 4px;
  border-color: rgba(205, 219, 239, 0.92);
  border-radius: 12px;
  background: #f8fbff;
}

.product-body {
  padding: 24px 18px;
}

.dataset-name {
  color: #e26b00;
  font-size: 16px;
}

.product-name {
  font-size: 28px;
}

.first-date {
  color: #68728d;
  font-size: 18px;
}

.product-fields {
  gap: 10px;
  margin-top: 14px;
}

.field-item {
  min-height: 68px;
  padding: 12px 14px;
  border-color: rgba(214, 224, 241, 0.96);
  border-radius: 12px;
  background: rgba(250, 252, 255, 0.8);
}

.field-label {
  color: #68728d;
  font-size: 14px;
}

.field-value {
  font-size: 16px;
}

@media (max-width: 820px) {
  .app-shell {
    width: 100%;
    padding-top: 0;
  }

  .hero-panel {
    min-height: 360px;
    border-radius: 0 0 28px 28px;
    padding: 24px 26px 16px;
    background-image:
      linear-gradient(90deg, rgba(12, 37, 92, 0.9) 0%, rgba(23, 62, 130, 0.5) 36%, rgba(11, 32, 72, 0.04) 66%),
      linear-gradient(180deg, rgba(11, 32, 72, 0), rgba(11, 32, 72, 0.08)),
      url("./assets/home-banner.jpg");
    background-size: cover, cover, auto 100%;
    background-position: center, center, 58% top;
  }

  .hero-content {
    position: static;
    width: 100%;
  }

  .credit {
    min-height: 24px;
    margin-bottom: 10px;
    padding: 0 10px;
    font-size: 11px;
  }

  .credit::before {
    width: 17px;
    height: 17px;
    margin-right: 6px;
    font-size: 10px;
  }

  h1 {
    max-width: 260px;
    font-size: 25px;
  }

  .hero-subtitle {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
  }

  .stats {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 52px;
    margin-top: 0;
    padding: 7px 6px;
    border-color: rgba(226, 238, 255, 0.46);
    border-radius: 13px;
    background: rgba(45, 78, 136, 0.28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.32),
      0 8px 22px rgba(15, 45, 95, 0.12);
    backdrop-filter: blur(10px) saturate(1.22);
  }

  .stats span {
    grid-template-columns: 36px 1fr;
    min-height: 40px;
    padding: 0 8px;
  }

  .stat-card::before {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .stats b {
    font-size: 19px;
  }

  .stats em {
    font-size: 10px;
  }

  .updated,
  .control-panel,
  .result-summary,
  .results {
    width: calc(100% - 34px);
  }

  .updated {
    margin-top: 10px;
    font-size: 13px;
  }

  .search-row {
    align-items: center;
    flex-direction: row;
    min-height: 62px;
    padding: 8px;
    border-radius: 15px;
  }

  .search-icon {
    width: 42px;
    font-size: 26px;
  }

  #search-input {
    height: 46px;
    font-size: 13px;
  }

  .search-button {
    min-width: 74px;
    min-height: 46px;
    border-radius: 14px;
    font-size: 13px;
  }

  .filter-shell summary {
    grid-template-columns: 1fr 1fr 1fr 1fr 14px;
    gap: 8px;
    min-height: 56px;
    padding: 8px 14px;
  }

  .filter-summary-title {
    font-size: 14px;
  }

  .filter-chip {
    min-width: 0;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .filter-block {
    grid-template-columns: 1fr;
  }

  .result-summary {
    flex-direction: row;
    align-items: center;
    min-height: 60px;
    padding: 0 22px;
  }

  .summary-tools {
    align-items: center;
    flex-direction: row;
  }

  .results {
    padding: 0 22px 18px;
  }

  .product-card {
    grid-template-columns: 124px minmax(0, 1fr) 16px;
    min-height: 196px;
  }

  .product-image-wrap {
    width: 108px;
    height: 136px;
    margin: 20px 0;
  }

  .product-body {
    padding: 18px 10px;
  }

  .dataset-name {
    font-size: 14px;
  }

  .product-name {
    font-size: 24px;
  }

  .first-date {
    font-size: 16px;
  }
}

@media (max-width: 520px) {
  .hero-panel {
    min-height: 350px;
    padding: 22px 22px 14px;
    background-size: cover, cover, auto 100%;
    background-position: center, center, 58% top;
  }

  h1 {
    max-width: 235px;
    font-size: 25px;
  }

  .hero-subtitle {
    font-size: 11px;
  }

  .stats {
    left: 22px;
    right: 22px;
    bottom: 16px;
  }

  .stats span {
    grid-template-columns: 32px 1fr;
    padding: 0 5px;
  }

  .stat-card::before {
    width: 30px;
    height: 30px;
  }

  .stats b {
    font-size: 18px;
  }

  .stats em {
    font-size: 10px;
  }

  .updated,
  .control-panel,
  .result-summary,
  .results {
    width: calc(100% - 28px);
  }

  .search-row {
    gap: 8px;
  }

  .search-button {
    min-width: 68px;
    font-size: 13px;
  }

  .filter-shell summary {
    grid-template-columns: 1fr 1fr 1fr 14px;
    grid-template-areas:
      "title title title caret"
      "type year month caret";
    padding: 12px 14px;
  }

  .filter-summary-title {
    grid-area: title;
  }

  #dataset-filter-label {
    grid-area: type;
  }

  #year-filter-label {
    grid-area: year;
  }

  #month-filter-label {
    grid-area: month;
  }

  .filter-caret {
    grid-area: caret;
  }

  .filter-chip {
    font-size: 13px;
  }

  .result-summary {
    padding: 0 18px;
  }

  #match-count {
    font-size: 26px;
  }

  .sort-control,
  .sort-control select {
    font-size: 14px;
  }

  .results {
    padding: 0 18px 16px;
  }

  .product-card {
    grid-template-columns: 102px minmax(0, 1fr) 14px;
    min-height: 176px;
  }

  .product-card::after {
    font-size: 34px;
  }

  .product-image-wrap {
    width: 88px;
    height: 116px;
    margin: 18px 0;
  }

  .product-name {
    font-size: 21px;
  }

  .first-date {
    font-size: 14px;
  }

  .product-card .product-fields {
    gap: 6px;
    margin-top: 8px;
  }

  .product-card .field-item {
    min-height: 48px;
    padding: 7px 8px;
  }
}
