:root {
  color-scheme: dark;
  --page: #14031e;
  --page-deep: #080311;
  --panel: rgba(35, 11, 54, 0.94);
  --panel-2: rgba(45, 15, 65, 0.86);
  --line: rgba(158, 73, 247, 0.48);
  --ink: #f8f3ff;
  --muted: #b8a6cc;
  --violet: #7744e8;
  --pink: #e652ae;
  --cyan: #29c9e8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 3, 30, 0.68), rgba(8, 3, 17, 0.94)),
    url("./assets/bg.avif") top center / max(1280px, 100vw) auto no-repeat,
    var(--page-deep);
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 36%, rgba(68, 36, 190, 0.18), transparent 28%),
    radial-gradient(circle at 88% 15%, rgba(237, 73, 205, 0.14), transparent 22%);
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 130px;
}

.brand-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 7px 18px;
  overflow: hidden;
  border: 1px solid rgba(164, 76, 232, 0.42);
  border-radius: 22px;
  background: linear-gradient(125deg, rgba(41, 13, 61, 0.98), rgba(30, 7, 47, 0.91));
  box-shadow: 0 12px 36px rgba(8, 0, 18, 0.34), inset 0 1px rgba(255,255,255,.04);
}

.brand-header::before {
  content: "";
  position: absolute;
  inset: 0 0 0 67%;
  background: url("./assets/bg.avif") 83% 30% / 520px auto no-repeat;
  opacity: .7;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}

.brand-header::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7249ff, #ef5ecb, transparent);
  opacity: .85;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  height: 49px;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}
.jiahe-brand-logo { display: block; width: 142px; height: 49px; object-fit: contain; }
.brand-separator { color: rgba(255, 255, 255, .68); font-size: 29px; font-weight: 200; line-height: 1; }
.pg-mark {
  display: block;
  width: 76px;
  height: 48px;
  overflow: hidden;
  background: url("./assets/brand.webp") right center / 252px 48px no-repeat;
}

.share-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(229, 166, 255, .7);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #7042de, #a3499e);
  box-shadow: 0 5px 14px rgba(92, 25, 139, .45);
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.share-button:hover { transform: translateY(-2px); filter: brightness(1.12); }
.share-button img { width: 29px; height: 29px; object-fit: contain; }

.hero {
  position: relative;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid rgba(136, 64, 221, .46);
  border-radius: 24px;
  background: #190728;
  box-shadow: 0 14px 36px rgba(8, 0, 20, .34);
}

.hero > img:first-child { display: block; width: 100%; aspect-ratio: 20 / 9; object-fit: cover; }
.hero-logo-patch {
  position: absolute;
  top: 5.5%;
  left: 11.2%;
  display: grid;
  place-items: center;
  width: 22%;
  height: 18.5%;
  padding: 1.1% 1.4%;
  border: 1px solid rgba(110, 198, 255, .38);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(3, 43, 83, .96), rgba(13, 72, 119, .93));
  box-shadow: 0 4px 16px rgba(0, 22, 56, .32), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
}
.hero-logo-patch img { display: block; width: 100%; height: 100%; object-fit: contain; }

.notice {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin: 10px 20px 0;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid rgba(161, 81, 220, .5);
  border-radius: 24px;
  background: rgba(50, 19, 61, .9);
}

.notice-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: #0a606a; box-shadow: 0 0 12px #18d9dd; }
.notice-window { min-width: 0; flex: 1; overflow: hidden; }
.notice p { min-width: max-content; margin: 0; color: #c9bdd8; font-size: 14px; font-weight: 700; text-align: center; animation: ticker 15s linear infinite; }
@keyframes ticker { from { transform: translateX(70%); } to { transform: translateX(-70%); } }

.platform-rail {
  display: flex;
  gap: 12px;
  margin: 14px 20px 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.platform-rail::-webkit-scrollbar { display: none; }
.platform-rail button {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  padding: 4px;
  border: 1px solid rgba(122, 68, 198, .55);
  border-radius: 50%;
  background: rgba(45, 17, 66, .78);
  box-shadow: inset 0 0 18px rgba(95, 58, 181, .2);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.platform-rail button:hover { transform: translateY(-3px); border-color: #d558c8; }
.platform-rail img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.platforms { margin-top: 34px; }
.platforms h1 { margin: 0; font-size: clamp(27px, 3vw, 34px); line-height: 1.25; text-align: center; letter-spacing: -.03em; text-shadow: 0 0 18px rgba(145, 103, 255, .32); }
.title-glow { width: 106px; height: 3px; margin: 10px auto 18px; border-radius: 999px; background: linear-gradient(90deg, transparent, #6745ff, #e55eae, #e68a3f, transparent); box-shadow: 0 0 14px rgba(190, 71, 223, .55); }

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

.platform-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 112px;
  gap: 12px;
  padding: 22px 17px 14px;
  overflow: hidden;
  border: 1px solid rgba(145, 70, 222, .54);
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 0%, rgba(20, 209, 224, .13), transparent 24%),
    linear-gradient(150deg, rgba(48, 17, 71, .96), rgba(28, 8, 43, .98));
  box-shadow: inset 0 1px rgba(255,255,255,.03), 0 12px 25px rgba(8, 0, 17, .13);
}

.platform-card::before { content: ""; position: absolute; top: 0; left: 24px; width: 58px; height: 2px; background: linear-gradient(90deg, #26d6e4, #7e57ff, transparent); }
.badge { position: absolute; top: 8px; right: 8px; padding: 3px 7px; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; color: #fff; background: linear-gradient(135deg, #ff3636, #ff7856); font-size: 12px; font-weight: 800; line-height: 1; box-shadow: 0 0 12px rgba(255,66,104,.35); }
.recommended .badge { background: linear-gradient(135deg, #583cff, #ad4ed0); }
.official .badge { background: linear-gradient(135deg, #0876f9, #25a5db); }
.avatar { width: 64px; height: 64px; border: 2px solid rgba(148, 91, 241, .75); border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px rgba(68,32,109,.7), 0 0 18px rgba(82, 61, 234, .25); }
.card-copy { min-width: 0; }
.card-copy h2 { margin: 0 0 4px; overflow: hidden; color: #fff; font-size: 17px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-copy p { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.platform-card > button {
  min-width: 90px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(231, 153, 255, .55);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(120deg, #6a43dd, #b24c9c);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}
.platform-card > button:hover { transform: translateY(-2px); filter: brightness(1.12); }
.platform-card > button:disabled { color: #bcb1ce; background: rgba(148, 69, 153, .6); cursor: not-allowed; }

.bottom-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(920px, calc(100% - 40px));
  height: 58px;
  padding: 0 46px;
  border: 1px solid rgba(128, 65, 190, .55);
  border-radius: 30px;
  background: rgba(18, 8, 37, .93);
  box-shadow: 0 12px 40px rgba(3, 0, 10, .5), inset 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(15px);
  transform: translateX(-50%);
}

.bottom-nav button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  padding: 0 0 7px;
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.bottom-nav button::after { content: ""; position: absolute; inset: auto 18% -1px; height: 2px; border-radius: 2px; background: transparent; }
.bottom-nav button.active::after { background: #794cff; box-shadow: 0 0 12px #9d63ff; }
.bottom-nav img { position: absolute; top: -21px; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(0,0,0,.4)); transition: transform .2s ease; }
.bottom-nav button:hover img { transform: translateY(-3px); }
.bottom-nav span { display: inline-flex; min-width: 44px; justify-content: center; padding: 2px 8px; border: 1px solid rgba(190,124,234,.58); border-radius: 10px; line-height: 1; background: rgba(38,16,61,.95); }
.bottom-nav .active span { background: linear-gradient(90deg, #5341ce, #a04db6); }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 94px;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  border: 1px solid rgba(217, 144, 255, .62);
  border-radius: 999px;
  color: #fff;
  background: rgba(39, 15, 58, .96);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid #b76cff; outline-offset: 3px; }

@media (max-width: 760px) {
  .page-shell { width: 100%; padding: 10px 10px 118px; }
  .brand-header { min-height: 58px; padding: 6px 10px; border-radius: 20px; }
  .brand { height: 42px; gap: 7px; }
  .jiahe-brand-logo { width: 125px; height: 42px; }
  .brand-separator { font-size: 24px; }
  .pg-mark { width: 65px; height: 40px; background-size: 210px 40px; }
  .share-button { width: 45px; height: 45px; }
  .hero { margin-top: 10px; border-radius: 18px; }
  .hero > img:first-child { aspect-ratio: 16 / 7.2; }
  .hero-logo-patch { border-radius: 6px; }
  .notice { min-height: 43px; margin: 9px -2px 0; padding: 0 14px; }
  .notice p { font-size: 13px; }
  .platform-rail { gap: 12px; margin: 9px -2px 0; padding: 10px 7px; border: 1px solid rgba(143, 67, 206, .45); border-radius: 22px; background: rgba(35, 12, 52, .78); }
  .platform-rail button { flex-basis: 49px; width: 49px; height: 49px; padding: 2px; }
  .platforms { margin-top: 24px; }
  .platforms h1 { font-size: 27px; }
  .title-glow { margin-bottom: 14px; }
  .platform-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 0 10px; }
  .platform-card { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; min-height: 130px; gap: 4px; padding: 25px 6px 7px; border-radius: 18px; text-align: center; }
  .platform-card::before { left: 12px; width: 36px; }
  .badge { top: 5px; right: 5px; padding: 3px 5px; font-size: 10px; }
  .avatar { width: 50px; height: 50px; border-width: 1px; box-shadow: 0 0 0 3px rgba(68,32,109,.65); }
  .card-copy { width: 100%; }
  .card-copy h2 { margin: 0; font-size: 12px; letter-spacing: -.04em; }
  .card-copy p { display: none; }
  .platform-card > button { width: 100%; min-width: 0; min-height: 32px; padding: 0 4px; border-radius: 11px; font-size: 12px; }
  .bottom-nav { bottom: 0; width: 100%; height: 58px; padding: 0 7px env(safe-area-inset-bottom); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; }
  .bottom-nav img { top: -19px; width: 49px; height: 49px; }
  .bottom-nav button { padding-bottom: 5px; }
  .toast { bottom: 76px; font-size: 14px; }
}

@media (max-width: 360px) {
  .platform-grid { gap: 5px; padding: 0 2px; }
  .platform-card { padding-inline: 4px; }
  .platforms h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .notice p { animation: none; min-width: 0; text-align: right; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
