:root {
  --orange: #ff6b35;
  --orange-deep: #f04e1f;
  --orange-2: #ff9a3d;
  --orange-soft: #fff1e8;
  --orange-soft-2: #ffe4d0;
  --bg: #fff9f5;
  --card: #ffffff;
  --line: #f3e4d8;
  --line-strong: #e8d5c5;
  --text: #2d2320;
  --text-2: #7a6a5f;
  --text-3: #a6958a;
  --green: #23845e;
  --green-soft: #e7f6ef;
  --red: #c9383d;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(180, 90, 30, .08);
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
}

body {
  min-width: 320px;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

button,
select {
  max-width: 100%;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(255, 107, 53, .28);
  outline-offset: 2px;
}

.brandbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(100%, 1180px);
  margin: 0 auto;
  border-radius: 0 0 22px 22px;
  padding: 14px 16px 16px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  box-shadow: 0 3px 14px rgba(240, 78, 31, .25);
  color: #fff;
}

.brandbar-inner {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.brandbar-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.brandbar-tab {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.brandbar-tab.active { background: #fff; color: var(--orange-deep); }

.brand {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  padding: 4px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(63, 29, 14, .14);
}

.brand span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand strong {
  overflow: hidden;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  overflow: hidden;
  margin-top: 3px;
  color: rgba(255, 255, 255, .84);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-home {
  flex: none;
  min-width: 104px;
  min-height: 42px;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 9px 14px;
  background: #fff;
  color: var(--orange-deep);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.back-home:active {
  transform: translateY(1px);
}

main {
  display: grid;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 14px 14px 46px;
  gap: 12px;
}

.hero,
.picker-card,
.results-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 142px;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  overflow: hidden;
  border-color: #ffd9be;
  background: linear-gradient(90deg, var(--orange-soft), var(--orange-soft-2));
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--orange-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .11em;
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -.03em;
}

.hero p:last-child {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--text-2);
  line-height: 1.65;
}

.hero-mark {
  display: grid;
  width: 68px;
  height: 68px;
  flex: none;
  place-items: center;
  border: 1px solid #ffc89e;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  color: var(--orange-deep);
  font-size: 26px;
  font-weight: 850;
}

.picker-card,
.results-card {
  padding: 20px;
}

.section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head > div {
  min-width: 0;
}

.section-head h2 {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.text-button {
  min-height: 40px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

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

.location-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.location-grid label > span {
  color: var(--text-2);
  font-size: 12px;
}

.location-grid b {
  margin-right: 3px;
  color: var(--orange-deep);
  font-size: 11px;
}

.location-grid select {
  width: 100%;
  height: 46px;
  min-width: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 36px 0 12px;
  outline: none;
  background: #fff;
  color: var(--text);
}

.location-grid select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
}

.location-grid select:disabled {
  border-color: #eee5de;
  background: #f8f4f0;
  color: var(--text-3);
  opacity: 1;
}

.selection-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 16px;
}

.selection-line > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text-2);
  font-size: 13px;
}

.selection-line button {
  min-width: 132px;
  min-height: 44px;
  flex: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 78, 31, .24);
}

.selection-line button:disabled {
  background: #e7ddd5;
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--green);
  font-size: 12px;
  line-height: 1.55;
}

.status.is-error {
  color: var(--red);
}

.count-pill {
  flex: none;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

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

.market-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  min-width: 0;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  background: #fff;
}

.market-date {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 850;
}

.market-row h3 {
  overflow-wrap: anywhere;
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.market-row p {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
}

.market-row .rule {
  margin-top: 4px;
  color: var(--orange-deep);
  font-weight: 650;
}

.empty-state {
  display: grid;
  min-height: 138px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  padding: 18px;
  color: var(--text-2);
  text-align: center;
}

.empty-state span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid #ffc89e;
  border-radius: 13px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 17px;
  font-weight: 800;
}

.empty-state p {
  max-width: 420px;
  margin: 0;
  line-height: 1.65;
}

footer {
  display: grid;
  gap: 2px;
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

footer p {
  margin: 0;
}

footer a {
  color: inherit;
  text-underline-offset: 2px;
}

.public-security-record { display: inline-flex; align-items: center; gap: 5px; }
.public-security-record span { display: inline-grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; background: #173a61; color: #ffb23f; font-size: 8px; font-weight: 900; }

@media (max-width: 720px) {
  .brandbar {
    border-radius: 0 0 18px 18px;
    padding: 10px 12px 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 9px;
  }

  .brandbar-tabs {
    margin-top: 10px;
  }

  .brandbar-tab {
    min-height: 44px;
    padding: 8px 13px;
    font-size: 12px;
  }

  main {
    padding: 12px 12px 32px;
    gap: 10px;
  }

  .hero {
    min-height: 0;
    gap: 10px;
    padding: 13px 14px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero p:last-child {
    display: -webkit-box;
    margin-top: 6px;
    overflow: hidden;
    font-size: 10px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hero-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 18px;
  }

  .picker-card,
  .results-card {
    padding: 12px;
  }

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

  .selection-line {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .selection-line button {
    width: 100%;
  }

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

@media (max-width: 720px) {
  .location-grid label { gap: 5px; }
  .location-grid select { height: 42px; border-radius: 11px; padding-left: 10px; }
  .selection-line { gap: 10px; margin-top: 12px; padding-top: 12px; }
  .selection-line button { min-height: 40px; padding: 8px 13px; }
  .section-head { gap: 10px; margin-bottom: 10px; }
  .section-head h2 { font-size: 17px; }
}

@media (max-width: 355px) {
  .brand strong {
    font-size: 13px;
  }

  .brand small {
    display: none;
  }

  .back-home {
    min-width: 90px;
    padding-inline: 9px;
  }

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

/* 小程序原生导航栏之下保留完整的品牌卡，避免顶部圆角和内容被贴顶裁切。 */
html.in-mini-program .brandbar {
  position: relative;
  top: auto;
  width: calc(100% - 24px);
  margin: 12px 12px 0;
  border-radius: 18px;
}

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