/* H5 采用 750px 二倍稿（375px CSS 宽），PC 采用 600px 居中内容区。 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: clamp(12.8px, 4.26666667vw, 16px);
  -webkit-text-size-adjust: 100%;
}

/* 仅隐藏滚动条外观，保留整页滚动及原有滚动交互。 */
html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  min-height: 100vh;
  background: #050508;
  color: #fff;
  font-family: "Source Han Sans", "Noto Sans CJK SC", -apple-system,
    BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  line-height: 1.5;
}

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

button {
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* 尺寸集中在页面变量；断点只覆盖设计稿中 PC 与 H5 不同的值。 */
.page {
  --page-gutter: 0.625rem;
  --brand-width: 11.21240234375rem;
  --brand-height: 3.125rem;
  --header-gap: 3.375rem;
  --main-offset: 3.3125rem;
  --section-gap: 0.625rem;
  --title-gap: 0.546875rem;
  --title-size: 0.625rem;
  --title-line: 0.9375rem;
  --card-height: 3.125rem;
  --card-padding: 0.390625rem;
  --card-radius: 0.4375rem;
  --card-shadow: 0 0.15625rem 0.15625rem rgb(0 0 0 / 50%);
  --icon-size: 2.34375rem;
  --list-gap: 0.390625rem;
  --grid-gap: 0.3125rem;
  --product-size: 0.75rem;
  --product-line: 1.125rem;
  --description-size: 0.625rem;
  --description-line: 0.9375rem;
  --latency-size: 0.5625rem;
  --latency-line: 0.8125rem;
  --latency-fast-color: #00e5ff;
  --action-gap: 0.234375rem;
  --button-width: 2.34375rem;
  --button-height: 1.09375rem;
  --button-size: 0.625rem;
  --footer-margin: 0.9375rem;
  --footer-gap: 0.390625rem;
  --footer-bottom: 1.859375rem;
  --footer-height: 2.34375rem;
  --footer-size: 0.75rem;
  --footer-line: 1.09375rem;
  --tip-size: 0.5rem;
  --tip-line: 0.71875rem;
  --brand-gradient: linear-gradient(90deg, #ca40e4 0%, #1d3fee 100%);
  position: relative;
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  margin-inline: auto;
  background: #0e0e11;
}

/* 背景素材已含黑色遮罩及横向裁切，仅补顶部和底部的渐隐。 */
.header {
  position: relative;
  z-index: 0;
}

.header__bg {
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 750 / 532.5;
  overflow: hidden;
  pointer-events: none;
}

.header__bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header__bg::before,
.header__bg::after {
  position: absolute;
  right: 0;
  left: 0;
  content: "";
}

.header__bg::before {
  top: 0;
  height: 26.2910798122%;
  background: linear-gradient(to bottom, #050508, rgb(5 5 8 / 0%));
}

.header__bg::after {
  bottom: 0;
  height: 35.2112676056%;
  background: linear-gradient(to top, #0e0e11, rgb(14 14 17 / 0%));
}

.header__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--header-gap);
  padding: calc(var(--page-gutter) + env(safe-area-inset-top, 0px))
    var(--page-gutter) 0;
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  line-height: 1;
}

.brand__logo {
  width: var(--brand-width);
  height: var(--brand-height);
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* 短地址匹配设计尺寸；长地址可换行并撑高，不挤出页面。 */
.address-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-width: 8.0078125rem;
  max-width: 100%;
  min-height: 3.28125rem;
  margin-inline: auto;
  padding: 0.46875rem 1.5rem;
  border: 0;
  border-radius: 0.390625rem;
  background: var(--brand-gradient);
  color: #fff;
  text-align: center;
}

button.address-card {
  cursor: pointer;
}

.address-card__label {
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.03125rem;
}

.address-card__url {
  max-width: 100%;
  margin-top: -0.15625rem;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.46875rem;
  overflow-wrap: anywhere;
}

.main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  margin-top: var(--main-offset);
  padding-inline: var(--page-gutter);
}

.section {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--title-gap);
}

.section__title {
  font-size: var(--title-size);
  font-weight: 400;
  line-height: var(--title-line);
  overflow-wrap: anywhere;
}

.app-list {
  display: flex;
  flex-direction: column;
  gap: var(--list-gap);
}

.h5-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.app-card,
.h5-card {
  display: flex;
  min-width: 0;
  min-height: var(--card-height);
  align-items: center;
  gap: var(--card-padding);
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
}

.app-card__icon,
.h5-card__icon {
  flex-shrink: 0;
  width: var(--icon-size);
  height: var(--icon-size);
  border-radius: var(--card-radius);
  background: #d9d9d9;
  object-fit: cover;
}

.app-card__info,
.h5-card__info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.app-card__name,
.h5-card__name {
  overflow: hidden;
  color: #1a1a1a;
  font-size: var(--product-size);
  font-weight: 900;
  line-height: var(--product-line);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card__desc {
  overflow: hidden;
  color: #9a9a9a;
  font-size: var(--description-size);
  line-height: var(--description-line);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card__action {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--action-gap);
}

.latency {
  color: var(--latency-fast-color);
  font-size: var(--latency-size);
  font-weight: 500;
  line-height: var(--latency-line);
  white-space: nowrap;
}

.btn-enter {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: var(--button-width);
  min-height: var(--button-height);
  padding-inline: calc(var(--button-width) * 7 / 30);
  border-radius: 999px;
  background: var(--brand-gradient);
  color: #fff;
  font-size: var(--button-size);
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
}

/* 公共底部随列表自然向下排，不固定定位遮盖产品。 */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--footer-gap);
  margin-top: var(--footer-margin);
  padding: 0 var(--page-gutter)
    calc(var(--footer-bottom) + env(safe-area-inset-bottom, 0px));
}

.footer__tg {
  display: flex;
  width: 100%;
  min-height: var(--footer-height);
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  background: var(--brand-gradient);
  color: #fff;
  font-size: var(--footer-size);
  font-weight: 500;
  line-height: var(--footer-line);
  text-align: center;
}

.footer__tg-label {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer__tip {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: var(--tip-size);
  font-weight: 500;
  line-height: var(--tip-line);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.footer__tip:active {
  opacity: 0.75;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

[aria-disabled="true"] {
  cursor: default;
}

.empty-state {
  padding: 1.5rem 0.5rem;
  color: rgb(255 255 255 / 65%);
  text-align: center;
}

@media (min-width: 768px) {
  .page {
    --page-gutter: 1rem;
    --brand-width: 17.977294921875rem;
    --brand-height: 5rem;
    --header-gap: 2rem;
    --main-offset: 2rem;
    --section-gap: 1rem;
    --title-gap: 0.875rem;
    --title-size: 1rem;
    --title-line: 1.5rem;
    --card-height: 5rem;
    --card-padding: 0.625rem;
    --card-radius: 0.875rem;
    --card-shadow: 0 0.25rem 0.25rem rgb(0 0 0 / 50%);
    --icon-size: 3.75rem;
    --list-gap: 0.625rem;
    --grid-gap: 0.5rem;
    --product-size: 1rem;
    --product-line: 1.5rem;
    --description-size: 0.875rem;
    --description-line: 1.3125rem;
    --latency-size: 0.875rem;
    --latency-line: 1.25rem;
    --action-gap: 0.375rem;
    --button-width: 3.75rem;
    --button-height: 1.75rem;
    --button-size: 1rem;
    --footer-margin: 1.5rem;
    --footer-gap: 0.625rem;
    --footer-bottom: 1.5rem;
    --footer-height: 3.4375rem;
    --footer-size: 1rem;
    --footer-line: 1.4375rem;
    --tip-size: 0.75rem;
    --tip-line: 1.0625rem;
  }

  .address-card {
    min-width: 12.8125rem;
    min-height: 5.125rem;
    padding: 0.75rem 2.5rem;
    border-radius: 0.625rem;
  }

  .address-card__label {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .address-card__url {
    margin-top: -0.25rem;
    font-size: 1.625rem;
    line-height: 2.375rem;
  }

  .footer__tg {
    padding-block: 1rem;
    border-radius: 0.625rem;
  }
}
