:root {
  --ink: #102f35;
  --deep: #0b3d46;
  --deep-2: #072d34;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --line: #d8d5ca;
  --muted: #64757a;
  --accent: #e87838;
  --accent-soft: #fff0e5;
  --mint: #d9ebe6;
  --shadow: 0 18px 50px rgba(7, 45, 52, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(rgba(11, 61, 70, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 61, 70, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 88% 8%, rgba(232, 120, 56, 0.17), transparent 27%),
    var(--paper);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

button, input, select { font: inherit; }

.page {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 26px 24px;
  color: #f8faf6;
  background: linear-gradient(128deg, var(--deep-2), var(--deep));
  border-radius: 24px 24px 8px 8px;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -58px;
  top: -76px;
  border: 22px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.eyebrow { color: #a9d8cf; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; }
h1 { margin: 9px 0 6px; font-size: clamp(1.65rem, 6vw, 2.45rem); letter-spacing: 0.04em; }
.hero p { margin: 0; color: #c8ddd9; font-size: 0.95rem; }

.finder, .result-panel {
  background: rgba(255, 253, 247, 0.96);
  border: 1px solid rgba(216, 213, 202, 0.9);
  box-shadow: var(--shadow);
}

.finder { padding: 20px 22px 22px; border-top: 0; border-radius: 0 0 24px 24px; }
.selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; }

.field > span {
  display: block;
  margin: 0 0 8px;
  color: #52676c;
  font-size: 0.83rem;
  font-weight: 700;
}

.field > span b { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.08em; }

select, input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #cbd2cf;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

select { padding: 0 40px 0 13px; }
input { padding: 0 74px 0 15px; text-transform: uppercase; font-size: 1.05rem; }
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 120, 56, 0.14); }
select:disabled, input:disabled { color: #8d9b9e; background: #f0f0eb; }
.search-field { margin-top: 16px; }
.search-box { position: relative; }

#clearButton {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  padding: 0 10px;
  color: var(--deep);
  background: var(--mint);
  cursor: pointer;
}

.product-note {
  margin-top: 13px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  color: #5d6f72;
  background: var(--accent-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.result-panel { margin-top: 16px; padding: 18px 22px 22px; border-radius: 20px; }
.result-heading { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.status { color: var(--deep); font-weight: 800; }
.count { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.results { display: grid; gap: 12px; margin-top: 14px; }
.welcome, .empty { padding: 28px 16px; text-align: center; color: var(--muted); line-height: 1.7; }

.item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  animation: rise 240ms ease both;
}

.item-main { padding: 14px 15px 13px; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.code {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 9px;
  color: #fff;
  background: var(--deep);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.category { color: var(--accent); font-family: Consolas, "SFMono-Regular", monospace; font-size: 0.82rem; font-weight: 800; }
.meaning { margin: 11px 0 0; color: #163a40; font-size: 1rem; font-weight: 800; line-height: 1.55; white-space: pre-wrap; }
.source { margin-top: 8px; color: #7a898b; font-size: 0.75rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: #f9f7f0; }
.detail-block { padding: 13px 15px 15px; }
.detail-block + .detail-block { border-left: 1px solid var(--line); }
.detail-label { margin-bottom: 7px; color: var(--accent); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; }
.detail-text { margin: 0; color: #41585c; font-size: 0.88rem; line-height: 1.65; white-space: pre-wrap; }
.note { margin: 0 15px 14px; padding: 9px 11px; border-radius: 9px; color: #74401e; background: var(--accent-soft); font-size: 0.8rem; }
footer { padding: 18px 8px 0; color: #748487; text-align: center; font-size: 0.74rem; }

@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 620px) {
  .page { padding: 10px 10px calc(20px + env(safe-area-inset-bottom)); }
  .hero { padding: 22px 18px 20px; border-radius: 20px 20px 7px 7px; }
  .finder { padding: 17px 14px 18px; border-radius: 0 0 20px 20px; }
  .selectors { grid-template-columns: 1fr; gap: 13px; }
  .result-panel { padding: 15px 13px 17px; }
  .result-heading { align-items: baseline; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block + .detail-block { border-left: 0; border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
