:root {
  --bg: #101214;
  --panel: #181c20;
  --panel-2: #20262c;
  --text: #eef2f2;
  --muted: #91a0a4;
  --line: #2f383f;
  --accent: #7bd88f;
  --accent-2: #f2c14e;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(123, 216, 143, 0.14), transparent 30rem),
    linear-gradient(135deg, #101214, #15191c 45%, #0d0f10);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.notice-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(123, 216, 143, 0.26);
  border-radius: 8px;
  background: rgba(24, 28, 32, 0.72);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
}

.banner-marquee {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  border-inline: 1px solid rgba(123, 216, 143, 0.16);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.banner-track {
  display: flex;
  width: max-content;
  gap: 26px;
  animation: banner-scroll 22s linear infinite;
}

.banner-marquee:hover .banner-track {
  animation-play-state: paused;
}

.banner-track a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: #f6d982;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.banner-track a::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 14px rgba(242, 193, 78, 0.8);
  content: "";
}

@keyframes banner-scroll {
  to {
    transform: translateX(-50%);
  }
}

.group-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.group-link:hover {
  color: #9be6ab;
}

.bookmark-button {
  flex: 0 0 auto;
  width: auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(242, 193, 78, 0.35);
  background: rgba(242, 193, 78, 0.08);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.bookmark-button:hover {
  border-color: var(--accent-2);
  background: rgba(242, 193, 78, 0.14);
}

.search-panel,
.result-head,
.goods {
  border: 1px solid var(--line);
  background: rgba(24, 28, 32, 0.92);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.search-panel {
  padding: 24px;
  border-radius: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 20px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 28px rgba(123, 216, 143, 0.28);
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
}

.query-row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 12px;
}

input,
select,
button {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  color: var(--text);
  font: inherit;
}

input,
select {
  padding: 0 12px;
}

button {
  cursor: pointer;
  border-color: transparent;
  background: var(--accent);
  color: #071009;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.tg-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 138px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(123, 216, 143, 0.38);
  background: rgba(123, 216, 143, 0.12);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.tg-login[hidden] {
  display: none;
}

.paper-plane {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: currentColor;
}

.paper-plane svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.tg-login:hover {
  border-color: var(--accent);
  background: rgba(123, 216, 143, 0.18);
}

.auth-user {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 32px;
  margin-right: 8px;
  padding: 0 12px;
  border: 1px solid rgba(242, 193, 78, 0.34);
  border-radius: 8px;
  background: rgba(242, 193, 78, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-link[hidden] {
  display: none;
}

#searchButton.loading {
  position: relative;
  padding-left: 30px;
  background: #9be6ab;
}

#searchButton.loading::before {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid rgba(7, 16, 9, 0.25);
  border-top-color: #071009;
  border-radius: 50%;
  content: "";
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hotwords {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
}

.hotword-title {
  color: var(--muted);
  line-height: 30px;
}

.hotword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hotword {
  width: auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 54px;
  margin: 18px 0 12px;
  padding: 0 18px;
  border-radius: 8px;
}

#resultMeta,
.status-text {
  color: var(--muted);
  font-size: 14px;
}

.results {
  display: grid;
  gap: 10px;
}

.goods {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 290px;
  gap: 16px;
  min-height: 112px;
  padding: 14px 16px;
  border-radius: 8px;
}

.goods.pinned-promo {
  position: relative;
  border-color: rgba(242, 193, 78, 0.72);
  background:
    linear-gradient(135deg, rgba(242, 193, 78, 0.13), rgba(123, 216, 143, 0.05)),
    rgba(24, 28, 32, 0.96);
  box-shadow:
    0 0 0 1px rgba(242, 193, 78, 0.16) inset,
    0 22px 70px rgba(242, 193, 78, 0.15);
}

.goods.pinned-promo .platform-chip {
  border-color: rgba(242, 193, 78, 0.42);
  background: rgba(242, 193, 78, 0.12);
  color: var(--accent-2);
}

.goods.pinned-promo .badge {
  position: absolute;
  right: 14px;
  bottom: 8px;
  padding: 0;
  background: transparent;
  color: #6f7b80;
  font-size: 12px;
  font-weight: 500;
}

.goods-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
  min-width: 0;
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: fit-content;
  padding: 3px 7px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 24, 0.8);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.platform-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.goods-name {
  display: -webkit-box;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.goods-name:hover {
  color: var(--accent);
}

.badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(123, 216, 143, 0.14);
  color: var(--accent);
  font-size: 12px;
}

.badge.offline {
  background: rgba(255, 107, 107, 0.14);
  color: var(--danger);
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.goods-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-right: 1px solid var(--line);
  padding-right: 16px;
}

.detail-button {
  width: auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(242, 193, 78, 0.32);
  background: rgba(242, 193, 78, 0.1);
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 700;
}

.detail-button:hover {
  border-color: var(--accent-2);
  background: rgba(242, 193, 78, 0.16);
}

.goods-side {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 6px 14px;
  align-content: center;
  padding-left: 0;
}

.goods-side .price {
  grid-row: span 3;
}

.price {
  font-size: 25px;
  font-weight: 800;
  color: var(--accent-2);
  line-height: 1.15;
}

.stock,
.shop,
.contact {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.shop {
  color: var(--accent);
  text-decoration: none;
}

.empty {
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.login-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  margin-top: 12px;
  padding: 18px;
  border: 1px solid rgba(242, 193, 78, 0.32);
  border-radius: 8px;
  background: rgba(242, 193, 78, 0.08);
}

.login-gate[hidden] {
  display: none;
}

.login-gate strong {
  color: var(--accent-2);
  font-size: 17px;
}

.login-gate span {
  grid-column: 1;
  color: var(--muted);
  font-size: 14px;
}

.login-gate .tg-login {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(242, 193, 78, 0.35);
  border-radius: 8px;
  background: #171b1f;
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.44);
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.realtime-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 10px 12px;
  border: 1px solid rgba(123, 216, 143, 0.24);
  border-radius: 8px;
  background: rgba(17, 21, 24, 0.88);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.realtime-widget div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.realtime-widget span {
  color: var(--muted);
  font-size: 12px;
}

.realtime-widget strong {
  color: var(--accent);
  font-size: 15px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 8, 0.74);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(84vh, 820px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15191c;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: 0;
}

.modal-platform {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.modal-platform img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.modal-meta,
.modal-contact {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #111518;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.modal-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  min-width: 292px;
}

.modal-head-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.modal-head-actions a:hover {
  border-color: var(--accent);
  background: rgba(123, 216, 143, 0.08);
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px 0;
}

.modal-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.modal-stats span:first-child {
  color: var(--accent-2);
  font-weight: 800;
}

.modal-contact {
  padding: 0 20px;
}

.modal-description {
  max-height: calc(84vh - 238px);
  overflow: auto;
  margin: 14px 20px 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101417;
  color: #dbe3e3;
  line-height: 1.7;
}

.modal-description img {
  max-width: 100%;
  height: auto;
}

body.modal-locked {
  overflow: hidden;
}

@media (max-width: 860px) {
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .goods {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .goods-actions {
    align-items: flex-start;
    justify-content: flex-start;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .goods-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .goods-side .price {
    grid-row: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-user {
    text-align: left;
  }

  .notice-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .banner-marquee {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .query-row {
    grid-template-columns: 1fr;
  }

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

  .result-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
  }

  .login-gate {
    grid-template-columns: 1fr;
  }

  .login-gate span,
  .login-gate .tg-login {
    grid-column: 1;
    grid-row: auto;
  }

  .goods {
    padding: 12px;
  }

  .goods-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .goods-side {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-head {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .modal-stats,
  .modal-head-actions {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-head-actions {
    justify-content: flex-start;
    min-width: 0;
    padding: 0;
  }

  .modal-contact {
    padding: 0 14px;
  }

  .modal-description {
    max-height: calc(100vh - 260px);
    margin: 12px 14px 14px;
  }

  .realtime-widget {
    right: 10px;
    bottom: 10px;
    min-width: 118px;
    padding: 8px 10px;
  }
}
