:root {
  --bg: #f4efe6;
  --bg-strong: #e8dece;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: #fffaf2;
  --ink: #1f2a21;
  --muted: #5b665b;
  --line: rgba(31, 42, 33, 0.12);
  --accent: #1f5a43;
  --accent-soft: rgba(31, 90, 67, 0.1);
  --amber: #b76e1b;
  --shadow: 0 18px 50px rgba(38, 35, 28, 0.09);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 28%),
    linear-gradient(180deg, #f8f3ea 0%, var(--bg) 55%, #efe4d2 100%);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1600px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  padding: 34px;
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.92), rgba(234, 226, 211, 0.96)),
    linear-gradient(180deg, rgba(31, 90, 67, 0.08), transparent 50%);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

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

.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.control-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.panel-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 42, 33, 0.08);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(31, 42, 33, 0.06);
  backdrop-filter: blur(8px);
}

.field-group + .field-group {
  margin-top: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(31, 42, 33, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.search-input:focus,
select:focus {
  outline: 2px solid rgba(31, 90, 67, 0.18);
  border-color: rgba(31, 90, 67, 0.4);
}

.field-tip,
.meta-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.toggle-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-item input {
  width: 16px;
  height: 16px;
}

.ghost-button {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(31, 42, 33, 0.16);
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
}

.rail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rail-list.compact {
  gap: 8px;
}

.rail-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(31, 42, 33, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.rail-chip:hover,
.rail-chip.active {
  background: var(--accent-soft);
  border-color: rgba(31, 90, 67, 0.26);
  transform: translateY(-1px);
}

.rail-chip small {
  color: var(--muted);
}

.content {
  min-width: 0;
}

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

.summary-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid rgba(31, 42, 33, 0.08);
  box-shadow: 0 12px 28px rgba(31, 42, 33, 0.06);
}

.summary-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  line-height: 1;
}

.summary-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.result-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 22px 0 16px;
}

.results-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.results-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.results-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

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

.product-card {
  overflow: hidden;
  border: 1px solid rgba(31, 42, 33, 0.08);
  border-radius: 24px;
  background: rgba(255, 251, 246, 0.92);
  box-shadow: 0 14px 32px rgba(31, 42, 33, 0.07);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 90, 67, 0.22);
  box-shadow: 0 20px 36px rgba(31, 42, 33, 0.1);
}

.card-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(233, 227, 216, 0.85)),
    linear-gradient(135deg, rgba(31, 90, 67, 0.08), transparent);
}

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

.image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.badge-stack {
  position: absolute;
  inset: 12px 12px auto 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(31, 42, 33, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.pill.highlight {
  background: rgba(183, 110, 27, 0.12);
  border-color: rgba(183, 110, 27, 0.24);
  color: #8d5210;
}

.product-body {
  padding: 16px;
}

.eyebrow-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.product-title {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.product-model {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.product-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  min-height: 42px;
}

.price-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.price-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.price-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.price-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.spread-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 90, 67, 0.08);
  color: var(--accent);
  font-size: 12px;
}

.empty-state {
  padding: 42px 24px;
  border: 1px dashed rgba(31, 42, 33, 0.16);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  color: var(--muted);
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0 8px;
}

.load-more-button {
  padding: 13px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(31, 90, 67, 0.2);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.load-more-button:hover {
  transform: translateY(-2px);
}

.load-more-button[hidden] {
  display: none;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.detail-drawer.open {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 17, 0.4);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100%;
  padding: 22px 22px 32px;
  background: #fffaf3;
  box-shadow: -20px 0 50px rgba(18, 20, 17, 0.18);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  overflow-y: auto;
}

.detail-drawer.open .drawer-backdrop {
  opacity: 1;
}

.detail-drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(31, 42, 33, 0.08);
  color: var(--ink);
  font-size: 26px;
  cursor: pointer;
}

.drawer-visual {
  overflow: hidden;
  margin-top: 10px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f6efe3, #efe4d2);
}

.drawer-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.drawer-body {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.drawer-head h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.drawer-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.drawer-metric {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.drawer-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.drawer-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

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

.detail-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 42, 33, 0.08);
}

.detail-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-item span {
  display: block;
  line-height: 1.7;
  word-break: break-word;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

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

  .control-panel {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero-stats,
  .summary-strip,
  .drawer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .control-panel {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .hero-stats,
  .summary-strip,
  .drawer-grid {
    grid-template-columns: 1fr;
  }

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

  .drawer-panel {
    width: 100vw;
    padding: 16px 16px 28px;
  }
}
