* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary-color: #1a0d43;
  --background-image: url("../img/background.png");
  --shadow-image: url("../img/shadow.png");
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  margin: 0;
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff var(--background-image) no-repeat bottom center;
  background-size: 100% auto;
  color: #333;
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: 100%;
  max-width: 750px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: visible;
  background: transparent;
  padding-bottom: calc(118px + var(--safe-bottom));
}

.query-panel,
.result-box,
.footer-copy,
.toast {
  position: relative;
  z-index: 1;
}

.query-panel {
  box-sizing: border-box;
  width: 70%;
  margin: 0 auto;
  padding: calc(116px + var(--safe-top)) 0 0;
  background: transparent;
  z-index: 5;
}

.brand-block {
  text-align: center;
  margin: 0 0 60px;
  color: #1e1d42;
}

.text-logo {
  display: none;
  font-size: 64px;
  line-height: 68px;
  font-weight: 800;
  letter-spacing: 0;
  color: #1e1d42;
}

.logo-image {
  display: block;
  max-width: 210px;
  height: auto;
  margin: 0 auto 10px;
}

.brand-block p {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 30px;
  width: 100%;
  min-width: 0;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  position: relative;
  z-index: 1;
}

.field.is-select-open {
  z-index: 2000;
}

.field span {
  font-size: 17px;
  line-height: 30px;
  color: #333;
  letter-spacing: 0;
}

.field select,
.field input {
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  border: 0;
  border-radius: 5px;
  background: #efefef;
  color: #999;
  font-size: 16px;
  outline: none;
}

.native-select {
  display: none;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 1;
}

.custom-select.is-open {
  z-index: 2001;
}

.custom-select-trigger {
  width: 100%;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  border: 0;
  border-radius: 5px;
  background: #efefef;
  color: #999;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.custom-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  color: #999;
}

.custom-select-trigger i {
  width: 16px;
  height: 8px;
  display: block;
  flex: 0 0 auto;
  border: 0;
  background: url("../img/xiala1.png") no-repeat center;
  background-size: 16px 8px;
  transform: none;
  margin-top: 0;
  transition: transform .2s ease, margin .2s ease;
}

.custom-select.is-open .custom-select-trigger i {
  transform: rotate(180deg);
  margin-top: 0;
}

.custom-select-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 56px;
  z-index: 2002;
  width: 100%;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d2d2d2;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
}

.custom-select.is-open .custom-select-menu {
  display: block;
}

.custom-option {
  width: 100%;
  height: 36px;
  border: 0;
  background: #fff;
  color: #777;
  padding: 0 15px;
  text-align: left;
  display: block;
  font-size: 16px;
  line-height: 36px;
}

.custom-option.is-selected {
  color: var(--primary-color);
  font-weight: 700;
}

.field input::placeholder {
  color: #9c9c9c;
  opacity: 1;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 50px 0 15px;
  background-color: #efefef;
  background-image: url("data:image/svg+xml,%3Csvg width='32' height='18' viewBox='0 0 32 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3l13 12L29 3' fill='none' stroke='%231b113c' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: calc(100% - 15px) 50%;
  background-size: 16px 8px;
  background-repeat: no-repeat;
}

.search-control {
  display: flex;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 5px;
}

.search-control input {
  width: 0;
  min-width: 0;
  flex: 1 1 auto;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding: 0 15px;
}

.search-control button {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  height: 50px;
  min-height: 50px;
  max-height: 50px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0 5px 5px 0;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-control img {
  width: 24px;
  height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: block;
}

.result-box {
  display: none;
  width: 100%;
  margin: 0;
  padding-top: 40px;
  padding-bottom: 40px;
  background: var(--shadow-image) no-repeat top left;
  background-size: 100% auto;
}

.result-box.is-visible {
  display: block;
}

.result {
  width: 90%;
  margin: 0 auto;
}

.result-title {
  margin-bottom: 5px;
  font-size: 16px;
  line-height: 30px;
  color: #333;
}

.result-title span {
  color: #8373e5;
}

.result-title i {
  font-style: normal;
}

.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.result-list li {
  margin-bottom: 10px;
}

.result-head {
  width: 100%;
  height: auto;
  min-height: 50px;
  max-height: none;
  border: 0;
  border-radius: 5px;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 30px;
  font-weight: 500;
}

.result-head img {
  width: 21px;
  height: 11px;
  display: block;
  flex: 0 0 auto;
  transition: transform .2s ease;
}

.result-detail {
  display: none;
}

.result-list li.current .result-head {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.result-list li.current .result-head img {
  transform: rotate(180deg);
}

.result-list li.current .result-detail {
  display: block;
}

.detail-card {
  min-height: 0;
  background: #e8e6ec;
  display: flex;
  gap: 0;
  padding: 20px 15px;
}

.thumb {
  width: 35%;
  flex: 0 0 35%;
}

.thumb img {
  width: 100%;
  display: block;
}

.detail-text {
  flex: 1;
  min-width: 0;
  width: 65%;
  padding-top: 0;
  padding-left: 15px;
}

.detail-text h6 {
  margin: 0 0 10px;
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid #1a0e40;
  border-radius: 20px;
  font-size: 14px;
  line-height: 20px;
  color: #1a0e40;
  font-weight: 400;
}

.detail-text p {
  margin: 0;
  font-size: 14px;
  line-height: 24px;
  color: #666;
}

.detail-text span {
  color: #333;
}

.footer-copy {
  position: absolute;
  left: 0;
  bottom: calc(35px + var(--safe-bottom));
  width: 100%;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .5);
}

.footer-copy p {
  margin: 0 auto;
  width: 90%;
  font-size: 14px;
  line-height: 24px;
}

.footer-copy a {
  color: #8373e5;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  top: 30vh;
  transform: translateX(-50%);
  width: 72%;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.toast.show {
  opacity: 1;
}

.page-shell.is-result-page {
  overflow: visible;
  padding-bottom: calc(118px + var(--safe-bottom));
}

.page-shell.is-result-page .query-panel {
  width: 90%;
  padding-top: calc(50px + var(--safe-top));
}

.page-shell.is-result-page .brand-block {
  display: none;
}

.page-shell.is-result-page .form-grid {
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 30px;
}

.page-shell.is-result-page .search-field {
  grid-column: 1 / -1;
}

.page-shell.is-result-page .field select,
.page-shell.is-result-page .field input,
.page-shell.is-result-page .search-control button {
  height: 50px;
  min-height: 50px;
  max-height: 50px;
}

.page-shell.is-result-page .search-control button {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
}

.page-shell.is-result-page .result-box {
  margin-top: 0;
  padding-top: 40px;
  background-size: 100% auto;
  padding-bottom: 50%;
}

@media (max-width: 360px) {
  .query-panel {
    width: 70%;
  }

  .field span {
    font-size: 17px;
  }

  .field select,
  .field input,
  .search-control button {
    height: 50px;
    font-size: 16px;
  }

  .search-control button {
    min-width: 50px;
    width: 50px;
  }
}
