* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", sans-serif;
}

body {
  color: #fff;
  overflow: hidden;
}

.desktop-page,
.mobile-page {
  width: 100%;
  height: 100%;
}

/* Desktop */
.desktop-page {
  position: relative;
  z-index: 1;
  background: url("../images/bg.png") center center / cover no-repeat fixed;
}

.desktop-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 10, 35, 0.08) 0%,
    rgba(15, 10, 35, 0.18) 60%,
    rgba(10, 6, 25, 0.26) 100%
  );
  z-index: 0;
}

.desktop-page > * {
  position: relative;
  z-index: 1;
}

.top-left-logo {
  position: absolute;
  top: 28px;
  left: 34px;
}

.top-left-logo img {
  display: block;
  height: 46px;
  width: auto;
  object-fit: contain;
}

.top-right-service {
  position: absolute;
  top: 32px;
  right: 78px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 2px 20px 2px 18px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
}

.top-right-service .icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.top-right-service .icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
  opacity: 0.98;
}

.download-panel {
  position: absolute;
  left: 96px;
  bottom: 136px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0;
}

.qr-box {
  width: 136px;
  height: 136px;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

#qrcode canvas,
#qrcode img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.buttons-image {
  width: 165px;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Mobile */
.mobile-page {
  position: relative;
  background: url("../images/mobilebg.png") center top / cover no-repeat;
  height: 100%;
  overflow: hidden;
  padding: 10px 10px 0;
  display: flex;
  flex-direction: column;
}

.mobile-top {
  position: relative;
  flex-shrink: 0;
}

.mobile-head {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.mobile-download-btn {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 110px;
  display: block;
}

.mobile-download-btn img {
  width: 100%;
  display: block;
}

.mobile-tabs {
  margin-top: 10px;
  width: 100%;
  background: rgba(31, 31, 36, 0.92);
  border-radius: 10px;
  padding: 2px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  flex-shrink: 0;
}

.mobile-tabs span {
  text-align: center;
  color: #efefef;
  font-size: 15px;
  line-height: 34px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.mobile-tabs .active {
  background: #ff2d8e;
}

.mobile-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 74px;
  padding-bottom: 24px;
}

.mobile-card .thumb {
  width: 100%;
  height: 118px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

@supports (aspect-ratio: 1.5 / 1) {
  .mobile-card .thumb {
    height: auto;
    aspect-ratio: 1.5 / 1;
  }
}

.mobile-card p {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-service {
  position: fixed;
  right: 8px;
  top: 46%;
  transform: translateY(-50%);
  width: 66px;
  height: 102px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(15, 18, 33, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 8;
}

.mobile-service img {
  width: 30px;
  height: 30px;
}

.mobile-service span {
  font-size: 13px;
  line-height: 1;
  writing-mode: horizontal-tb;
  letter-spacing: 1px;
  white-space: nowrap;
}

.mobile-bottom-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 9;
}

.mobile-bottom-bg {
  width: 100%;
  display: block;
  border-radius: 14px;
}

.mobile-bottom-btn {
  position: absolute;
  display: block;
}

.mobile-bottom-btn img {
  width: 100%;
  display: block;
}

.btn-jisu {
  width: 94px;
  right: 86px;
  bottom: 12px;
}

.btn-guan {
  width: 94px;
  right: 2px;
  bottom: 12px;
}

/* 默认按桌面先展示，JS 会二次确认 */
.mobile-page {
  display: none;
}

.is-mobile .desktop-page {
  display: none;
}

.is-mobile .mobile-page {
  display: flex;
  flex-direction: column;
}

.is-desktop .desktop-page {
  display: block;
}

.is-desktop .mobile-page {
  display: none;
}

/* 无 JS 时也能大致自适应 */
@media (max-width: 900px), (pointer: coarse) {
  .desktop-page {
    display: none;
  }

  .mobile-page {
    display: flex;
    flex-direction: column;
  }

  body {
    overflow: hidden;
  }
}
