﻿/* ============================================================
   我要买（/youxi）· 游戏库页
   ============================================================ */

body.buy {
  background: #f3f5f9;
}

/* 顶部渐变：用 CSS 渐变替代原站背景图，省一次图片解码与固定图层重绘 */
body.buy::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 0;
  width: 100%;
  max-width: var(--app-width);
  height: 290px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(90% 80% at 55% 0%, #d9e6fb 0%, rgba(219, 230, 251, 0) 62%),
    radial-gradient(70% 60% at 96% 12%, #e7eefc 0%, rgba(231, 238, 252, 0) 60%),
    linear-gradient(180deg, #f2f7ff 0%, #f3f5f9 100%);
}

.gp {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 搜索栏 ---------- */
.gp-search {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 12px;
  background: #f1f6ff;
  box-shadow: 0 1px 0 rgba(214, 224, 244, .55);
}

.gp-search__back {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  color: var(--kr-blue-500);
}

.gp-search__back svg {
  width: 22px;
  height: 22px;
}

.gp-search__field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fff;
}

.gp-search__icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  color: #969799;
}

.gp-search__field input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #323233;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  appearance: none;
}

.gp-search__field input::placeholder {
  color: #ccc;
}

.gp-search__field input::-webkit-search-cancel-button {
  appearance: none;
}

/* ---------- 内容区 ---------- */
.gp-content {
  flex: 1;
  padding: 0 12px 64px;
}

/* 热门推荐 */
.gp-hot {
  margin-top: 12px;
}

.gp-hot h2 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
}

.gp-hot h2 svg {
  width: 18px;
  height: 18px;
  color: #ff5a3c;
}

.gp-hot ul {
  display: flex;
  flex-wrap: wrap;
}

.gp-hot li {
  width: 20%;
  margin-bottom: 12px;
  text-align: center;
}

.gp-hot a {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gp-hot img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f7;
}

.gp-hot h3 {
  max-width: 60px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ---------- 分类 tab ---------- */
.gp-body {
  margin-left: 8px;
}

.gp-tabs {
  position: sticky;
  top: 56px;
  z-index: 2;
  display: flex;
  height: 44px;
  background: #f3f5f9;
}

.gp-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 44px;
  padding: 5px 12px 5px 0;
  background: none;
}

.gp-tab h3 {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
}

.gp-tab__line {
  width: 24px;
  height: 4px;
  margin-top: 3px;
  border-radius: 2px;
  background: transparent;
}

.gp-tab.is-active h3 {
  color: var(--kr-blue-500);
  font-weight: 700;
}

.gp-tab.is-active .gp-tab__line {
  background: linear-gradient(90deg, #818fff, #5468ff);
}

/* ---------- 列表 ---------- */
.gp-column {
  position: relative;
}

.gp-chars {
  position: sticky;
  top: 100px;
  z-index: 1;
  float: right;
  display: flex;
  flex-direction: column;
  width: calc(min(100vw, 450px) * 4.8 / 100);
  text-align: center;
}

.gp-chars button {
  display: block;
  width: 100%;
  height: 18px;
  margin: 2px 0;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  line-height: 18px;
}

.gp-chars button:first-child {
  margin: 0 0 4px;
}

.gp-chars button:last-child {
  margin: 4px 0 0;
}

.gp-chars button.is-active {
  background: var(--kr-blue-500);
  color: #fff;
}

.gp-letter {
  margin: calc(min(100vw, 450px) * 3.2 / 100) 0;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 400;
}

.gp-list li {
  contain: layout paint style;
}

.gp-list a {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-right: 26px;
}

.gp-list img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f7;
}

.gp-list h3 {
  margin-left: 12px;
  overflow: hidden;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gp-empty {
  padding: 80px 0;
  color: var(--color-text-weak);
  font-size: 14px;
  text-align: center;
}

@media (hover: hover) {
  .gp-hot a:hover h3,
  .gp-list a:hover h3,
  .gp-tab:hover h3 {
    color: var(--kr-blue-500);
  }
}
