:root {
  color-scheme: light;
  --ink: #1c2a25;
  --muted: #68766f;
  --line: #dbe5dd;
  --paper: #fbfaf4;
  --surface: #fffefb;
  --soft: #edf5ee;
  --accent: #117a5d;
  --accent-dark: #0a604a;
  --accent-soft: #eaf4ec;
  --gold: #e7c56e;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(147, 184, 139, 0.18), transparent 28%),
    linear-gradient(180deg, #fbfaf3 0%, #edf5ed 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 38px 20px 42px;
}

.app-bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding: 4px 4px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: #2d7040;
  font-size: 18px;
  font-weight: 860;
}

.app-bar h1 {
  margin: 0;
  font-size: clamp(48px, 13vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.app-bar__subtitle {
  position: relative;
  width: fit-content;
  margin: 16px 0 0;
  color: #3e4844;
  font-size: 19px;
  font-weight: 520;
}

.app-bar__subtitle::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: -8px;
  width: 84px;
  height: 10px;
  border-bottom: 3px solid rgba(27, 125, 91, 0.42);
  border-radius: 50%;
}

.bamboo-mark {
  position: relative;
  width: 96px;
  height: 88px;
  flex: 0 0 96px;
  opacity: 0.62;
}

.bamboo-mark span {
  position: absolute;
  display: block;
  width: 70px;
  height: 24px;
  border-radius: 80% 20% 80% 20%;
  background: #8db281;
}

.bamboo-mark span:nth-child(1) {
  top: 6px;
  right: 8px;
  transform: rotate(-24deg);
}

.bamboo-mark span:nth-child(2) {
  top: 45px;
  right: 28px;
  transform: rotate(24deg);
}

.bamboo-mark span:nth-child(3) {
  top: 36px;
  right: -4px;
  transform: rotate(-62deg);
}

.query-card,
.results {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 42px rgba(41, 58, 50, 0.08);
}

.query-card {
  padding: 20px;
}

.query-card__header {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}

.section-icon {
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

.query-card__header h2,
.results h2 {
  margin: 0;
  font-size: 29px;
  line-height: 1.1;
  letter-spacing: 0;
}

.query-card__header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  grid-template-columns: 56px minmax(88px, 1fr) minmax(150px, 0.95fr);
  gap: 14px;
  align-items: center;
}

.field__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
  font-weight: 760;
}

.field__copy label {
  display: block;
  color: var(--ink);
  font-size: 19px;
  font-weight: 860;
}

.field__copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 12px;
  height: 12px;
  border-right: 3px solid #76847e;
  border-bottom: 3px solid #76847e;
  transform: translateY(-62%) rotate(45deg);
  pointer-events: none;
}

select {
  width: 100%;
  min-height: 66px;
  appearance: none;
  border: 1px solid #d6dfd8;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 25px;
  font-weight: 860;
  padding: 0 46px 0 16px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #168161 0%, #086046 100%);
  color: #fff;
  font-size: 25px;
  font-weight: 920;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.results {
  margin-top: 24px;
  padding: 20px 18px;
}

.flute-pack {
  margin-top: 18px;
}

.pack-toggle {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 18px;
  box-shadow: 0 12px 28px rgba(41, 58, 50, 0.07);
}

.pack-toggle span {
  font-size: 20px;
  font-weight: 860;
}

.pack-toggle strong {
  color: var(--accent);
  font-size: 16px;
}

.pack-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
}

.pack-group {
  border-bottom: 1px solid #e5ede7;
  padding: 10px 0;
}

.pack-group:last-child {
  border-bottom: 0;
}

.pack-group summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 17px;
  font-weight: 860;
}

.pack-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.pack-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid #d7e2db;
  border-radius: 999px;
  background: var(--surface);
  padding: 0 12px;
  color: #34443e;
  font-size: 15px;
  font-weight: 780;
}

.pack-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.results__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.results__header > div {
  display: flex;
  align-items: center;
}

#status {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}

.result-list {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.bag-prompt {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid #cfe1d7;
  border-radius: 10px;
  background: var(--accent-soft);
  padding: 14px;
}

.bag-prompt[hidden] {
  display: none;
}

.bag-prompt p {
  margin: 0;
  color: #365549;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 720;
}

.bag-prompt button {
  width: fit-content;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 860;
}

.result-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  border: 1px solid #e5ebe6;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.result-item--best {
  border-color: #7fb39c;
  background: linear-gradient(110deg, rgba(233, 245, 235, 0.94), #fff 58%);
  box-shadow: 0 12px 26px rgba(41, 94, 69, 0.08);
}

.result-item__rank {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f0f1ef;
  color: #222927;
  font-size: 22px;
  font-weight: 900;
}

.result-item--best .result-item__rank {
  background: var(--accent);
  color: #fff;
}

.result-item__body {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.best-badge {
  width: fit-content;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 820;
}

.result-item__headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-item__headline h3 {
  margin: 0;
  font-size: 23px;
  line-height: 1.25;
}

.result-item__headline span {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  border: 1px solid #9cc9b7;
  border-radius: 999px;
  color: var(--accent);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 860;
}

.result-item__headline span:last-child {
  background: rgba(255, 255, 255, 0.72);
}

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

dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}

dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 860;
  line-height: 1.28;
}

.reason-block {
  border-top: 1px solid #e4ece6;
  padding-top: 10px;
}

.reason-block h4 {
  margin: 0 0 8px;
  color: #4c5d55;
  font-size: 15px;
  font-weight: 860;
}

.reason-block ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reason-block li {
  border-radius: 999px;
  background: var(--accent-soft);
  color: #25674d;
  padding: 5px 9px;
  font-size: 14px;
  font-weight: 760;
}

.best-note {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #dce8df;
  padding-top: 12px;
  color: #167252;
  font-weight: 860;
}

.best-note span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4f9d7a;
  color: #fff;
  font-size: 14px;
}

@media (max-width: 520px) {
  .app {
    padding: 34px 16px 36px;
  }

  .bamboo-mark {
    width: 74px;
    height: 74px;
    flex-basis: 74px;
  }

  .bamboo-mark span {
    width: 56px;
    height: 18px;
  }

  .query-card,
  .results,
  .pack-panel,
  .pack-toggle {
    border-radius: 10px;
  }

  .field {
    grid-template-columns: 48px minmax(92px, 1fr) minmax(146px, 1fr);
    gap: 10px;
  }

  .field__icon {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  select {
    min-height: 62px;
    font-size: 24px;
  }

  .query-card__header h2,
  .results h2 {
    font-size: 27px;
  }

  .result-item {
    grid-template-columns: 48px 1fr;
    padding: 12px;
  }

  .result-item__rank {
    width: 44px;
    height: 44px;
  }

  dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
