:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697589;
  --line: #dfe7f1;
  --blue: #1769ff;
  --teal: #0a9b86;
  --amber: #d79a2b;
  --red: #ea5d5d;
  --shadow: 0 18px 46px rgba(31, 46, 76, 0.12);
  --radius: 8px;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(231, 240, 252, 0.96) 0, rgba(244, 247, 251, 0.96) 320px),
    repeating-linear-gradient(135deg, rgba(23, 105, 255, 0.05) 0 1px, transparent 1px 18px);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 16px 14px 108px;
}

.page-section[hidden] {
  display: none;
}

.hero-carousel {
  position: relative;
  min-height: 232px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #101827;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 520ms ease, transform 760ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 17, 31, 0.78), rgba(10, 17, 31, 0.24) 64%),
    linear-gradient(180deg, transparent, rgba(10, 17, 31, 0.34));
}

.hero-fallback {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(125deg, #14213d, #1769ff 48%, #0a9b86),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.38), transparent 28%);
}

.hero-copy {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 34px;
  z-index: 2;
  color: #fff;
}

.hero-copy small,
.card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy small {
  color: rgba(255, 255, 255, 0.84);
}

.hero-copy small::before,
.card-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.hero-copy h1 {
  margin: 9px 0 8px;
  max-width: 11em;
  font-size: clamp(30px, 8vw, 50px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  max-width: 24em;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  line-height: 1.6;
}

.hero-dots {
  position: absolute;
  left: 22px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 22px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
}

.hero-dot.is-active {
  width: 34px;
  background: #fff;
}

.search-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}

.global-search {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(215, 224, 236, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(31, 46, 76, 0.08);
}

.icon-search {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid #6f7b8e;
  border-radius: 50%;
}

.icon-search::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #6f7b8e;
  transform: rotate(45deg);
}

.global-search input,
.query-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.global-search input::placeholder,
.query-input input::placeholder {
  color: #9aa6b7;
}

#clearSearch {
  position: relative;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #edf2f8;
  color: var(--muted);
}

#clearSearch::before,
#clearSearch::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

#clearSearch::before {
  transform: rotate(45deg);
}

#clearSearch::after {
  transform: rotate(-45deg);
}

.udid-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.2);
}

.category-section,
.query-page,
.sign-page,
.help-page {
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.08;
}

.section-head em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.category-tabs {
  display: flex;
  gap: 10px;
  margin: 0 -14px 12px;
  padding: 0 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  min-width: 74px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d6e1ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-weight: 800;
}

.category-tab.is-active {
  border-color: rgba(23, 105, 255, 0.24);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(23, 105, 255, 0.2);
}

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

.software-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 14px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: inherit;
  text-align: left;
  box-shadow: 0 10px 26px rgba(31, 46, 76, 0.07);
}

.software-card:active {
  transform: translateY(1px);
}

.software-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f0fb;
}

.software-fallback {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.software-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.software-card span,
.software-card em {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  margin: 16px 0 0;
  padding: 22px;
  border: 1px dashed #cfd9e7;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.notice-card,
.query-card,
.help-item {
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(31, 46, 76, 0.08);
}

.notice-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.notice-card span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.notice-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.query-card {
  margin-top: 16px;
  padding: 20px;
}

.back-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d6e1ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-weight: 900;
}

.sign-card {
  display: grid;
  gap: 14px;
}

.sign-card .query-input {
  margin-top: 0;
}

.selected-app {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: #f9fbfe;
}

.selected-app strong,
.selected-app span,
.selected-app em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-app strong {
  font-size: 18px;
}

.selected-app span,
.selected-app em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.query-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.query-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.query-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  white-space: nowrap;
}

.query-input {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-top: 18px;
  padding: 0 16px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: #f9fbfe;
}

.plain-input {
  display: grid;
  gap: 8px;
}

.plain-input > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.plain-input input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  outline: 0;
  background: #f9fbfe;
  color: var(--ink);
}

.advanced-sign {
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: rgba(249, 251, 254, 0.72);
}

.advanced-sign summary {
  padding: 13px 14px;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.settings-panel {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.icon-upload {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #cbd9ea;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  cursor: pointer;
}

.icon-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-preview {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(23, 105, 255, 0.92), rgba(0, 158, 132, 0.92));
  background-position: center;
  background-size: cover;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
}

.icon-upload b {
  font-size: 15px;
}

.number-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
}

.number-stepper button,
.number-stepper input {
  min-height: 48px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: #f9fbfe;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.number-stepper button {
  background: rgba(23, 105, 255, 0.08);
  color: var(--blue);
  font-size: 22px;
}

.option-list {
  gap: 8px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 900;
}

.option-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

#querySubmit,
#signSubmit {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

#querySubmit {
  margin-top: 14px;
}

#querySubmit:disabled,
#signSubmit:disabled {
  opacity: 0.66;
}

.query-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-line {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #dfe7f1;
  border-radius: var(--radius);
  background: #f9fbfe;
}

.result-line strong {
  font-size: 16px;
}

.result-line span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-line a,
.result-line button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 900;
}

.help-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.help-item {
  overflow: hidden;
}

.help-toggle {
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.help-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-weight: 900;
}

.help-toggle strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.help-chevron {
  width: 11px;
  height: 11px;
  border-right: 2px solid #8a94a4;
  border-bottom: 2px solid #8a94a4;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.help-item.is-open .help-chevron {
  transform: rotate(225deg);
}

.help-content {
  margin: 0;
  padding: 0 18px 18px 56px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(430px, calc(100% - 28px));
  min-height: 68px;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(215, 224, 236, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(31, 46, 76, 0.18);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 4px;
  color: #6f7b8e;
  font-size: 12px;
  font-weight: 900;
}

.nav-item.is-active {
  color: var(--blue);
  background: rgba(23, 105, 255, 0.08);
}

.nav-icon {
  position: relative;
  width: 25px;
  height: 25px;
}

.nav-home::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 17px;
  height: 14px;
  border: 3px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.nav-home::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  width: 17px;
  height: 17px;
  border-left: 3px solid currentColor;
  border-top: 3px solid currentColor;
  transform: rotate(45deg);
}

.nav-query::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.nav-query::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.nav-help::before {
  content: "?";
  position: absolute;
  inset: 2px;
  display: grid;
  place-items: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 12px;
  }

  .hero-carousel {
    min-height: 220px;
  }

  .search-action-row {
    gap: 8px;
  }

  .global-search {
    min-height: 54px;
    padding: 0 12px;
  }

  .udid-card {
    min-height: 54px;
    padding: 0 12px;
  }

  .software-list {
    grid-template-columns: 1fr;
  }

  .query-head {
    align-items: flex-start;
  }

  .query-head h1 {
    font-size: 26px;
  }
}
