:root {
  color-scheme: dark;
  --bg: #08080d;
  --panel: #15151c;
  --panel-2: #101018;
  --line: #2a2a35;
  --text: #f5f5fb;
  --muted: #a3a1ad;
  --soft: #6f6cf6;
  --soft-dark: #49469b;
  --warning: #ffc400;
  --danger: #ff7373;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 74% 16%, rgba(69, 64, 140, 0.32), transparent 34%),
    linear-gradient(180deg, #0a0a10 0, #0b0a11 52%, #08080d 100%);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "Segoe UI",
    system-ui,
    sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 34px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
  padding: 18px 20px;
  border-bottom: 1px solid #1b1b24;
  background: rgba(6, 6, 10, 0.96);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #1f1d49;
}

.brand-mark span {
  width: 25px;
  height: 18px;
  border-left: 3px solid #7774ff;
  border-right: 3px solid #7774ff;
  transform: skewX(-16deg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.qr-button,
.menu-button {
  border: 0;
  color: #b8b8ff;
  cursor: pointer;
}

.qr-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #222252;
  font-weight: 800;
}

.menu-button {
  display: grid;
  gap: 5px;
  width: 38px;
  background: transparent;
}

.menu-button span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: #adadbb;
}

.hero {
  padding: 54px 20px 36px;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero p {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.35;
}

.query-card,
.tips-card,
.job,
.result-card,
.summary-card,
.empty-state {
  border: 1px solid var(--line);
  background: rgba(20, 20, 27, 0.82);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
}

.query-card,
.tips-card,
.job {
  margin: 0 20px;
  border-radius: 18px;
}

.query-card {
  padding: 26px;
}

.notice-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 196, 0, 0.35);
  border-radius: 16px;
  background: rgba(69, 47, 22, 0.28);
  padding: 18px;
}

.notice-icon,
.tips-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid currentColor;
  border-radius: 50%;
  color: var(--warning);
  font-weight: 900;
}

.notice-card strong {
  color: var(--warning);
  font-size: 18px;
}

.notice-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.activate-button {
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #1d1d29;
  color: var(--text);
  padding: 0 16px;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.query-form {
  display: grid;
  gap: 16px;
}

.channel-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border: 1px solid #2c2c38;
  border-radius: 16px;
  background: #0b0b12;
}

.channel-field label {
  min-width: 0;
}

.channel-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.channel-field span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.channel-field input:checked + span {
  background: var(--soft-dark);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(68, 65, 154, 0.28);
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: #c7c4d2;
  font-size: 13px;
}

.input-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  height: 62px;
  border: 2px solid #4e4bb4;
  border-radius: 18px;
  background: #07070c;
  box-shadow:
    0 0 0 3px rgba(111, 108, 246, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.input-shell input::placeholder {
  color: #66656f;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 62px;
  border: 0;
  border-radius: 16px;
  background: var(--soft-dark);
  color: #bbb9c4;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(68, 65, 154, 0.28);
  cursor: pointer;
}

.search-dot {
  width: 26px;
  height: 26px;
  border: 4px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.search-dot::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: -8px;
  width: 12px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.tips-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px;
  margin-top: 26px;
  padding: 22px 20px;
}

.tips-icon {
  color: #7774ff;
}

.tips-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.jobs {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.job {
  padding: 18px;
}

.job-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.job-label,
.job-message {
  color: var(--muted);
}

.job-label {
  margin: 0;
  font-size: 12px;
}

.job-title {
  margin: 4px 0 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.job-status {
  align-self: flex-start;
  border-radius: 999px;
  background: #242454;
  color: #c9c8ff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.job-message,
.job-error {
  margin: 10px 0 0;
  font-size: 13px;
}

.job-error {
  color: var(--danger);
}

.job-cancel {
  height: 34px;
  margin-top: 12px;
  border: 1px solid rgba(255, 115, 115, 0.35);
  border-radius: 10px;
  background: rgba(255, 115, 115, 0.1);
  color: var(--danger);
}

.summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border-radius: 14px;
  padding: 14px;
}

.summary-card span {
  color: var(--muted);
  font-size: 14px;
}

.summary-card strong {
  font-size: 24px;
}

.result-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.result-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: start;
  border-radius: 14px;
  padding: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b2b65, #7e4c7e);
  color: #ffffff;
  font-weight: 900;
}

.avatar img,
.gift-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-body {
  min-width: 0;
}

.result-top,
.name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.result-top {
  justify-content: space-between;
}

.name-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.level-badge {
  flex: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d45ff, #ff4f8b);
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
}

.time {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.gift-line {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.result-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.pill {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #22222c;
  color: #c8c5d1;
  padding: 6px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

a.pill {
  text-decoration: none;
}

.room-link[href] {
  color: #c9c8ff;
  border: 1px solid rgba(111, 108, 246, 0.28);
}

.room-link[href]::after {
  content: " ↗";
  font-weight: 900;
}

.value-pill {
  background: rgba(255, 196, 0, 0.12);
  color: #ffd25b;
  font-weight: 900;
}

.gift-thumb {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 10px;
  background: #22222c;
}

.empty-state {
  margin: 0 20px;
  border-radius: 16px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.compact-empty {
  margin: 14px 0 0;
}

@media (min-width: 800px) {
  body {
    background: #15151d;
  }

  .app-shell {
    margin: 18px auto;
    border: 1px solid #262632;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 370px) {
  .query-card {
    padding: 20px;
  }

  .notice-card {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .activate-button {
    grid-column: 2;
  }

  .result-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .gift-thumb {
    display: none;
  }
}
