:root {
  --bg: #ffffff;
  --text: #000000;
  --text-secondary: #8e8e93;
  --accent: #007aff;
  --hairline: #e5e5ea;
  --pill-bg: #f7f7f8;
  --tab-active-bg: #e8e8ed;
  --overlay: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

button:active {
  opacity: 0.72;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top, 0)) 0
    calc(92px + env(safe-area-inset-bottom, 0));
  position: relative;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
}

.top-header__title {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.top-header__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
}

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

.category-strip {
  display: flex;
  gap: 10px;
  padding: 12px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--pill-bg);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.pill__icon {
  font-size: 1rem;
  line-height: 1;
}

.carousel-section {
  padding-top: 8px;
}

.carousel__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* 不要在这里写 scroll-behavior: smooth，部分环境下会干扰手指横向拖动 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* pan-y：纵向仍交给浏览器滚页面；横向由 JS 拖动（桌面无原生横拖，部分 WebView 横滑也不可靠） */
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}

.carousel__viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.carousel__viewport .hero-card__plate {
  -webkit-user-drag: none;
  user-select: none;
}

.carousel__viewport::-webkit-scrollbar {
  display: none;
}

.carousel__viewport:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.carousel__track {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 16px 4px;
}

.hero-card {
  flex: 0 0 calc(100% - 36px);
  max-width: 400px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.hero-card__copy {
  padding: 16px 16px 8px;
}

.hero-card__eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

.hero-card__title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 4.2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-card__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.hero-card__media {
  position: relative;
  padding: 0 16px 16px;
}

/* 主视觉为纯色/渐变块，非图片；四周圆角 */
.hero-card__plate {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 520;
  border-radius: 14px;
  overflow: hidden;
}

.hero-card__plate--tax {
  background-image: url("/1.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  /*background: linear-gradient(165deg, #eceae6 0%, #dbd6d0 45%, #cbc4bc 100%);*/
}

.hero-card__plate--apps {
  background-image: url("/1.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  /*background: linear-gradient(155deg, #e4eaf1 0%, #cdd8e4 50%, #b9c7d6 100%);*/
}

.hero-card__plate--game {
  background-image: url("1.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.hero-card__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 14px;
  background: var(--overlay);
  color: #fff;
}

.hero-card__app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-card__app-icon--placeholder {
  background-image: url("../tp/1.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  
  border: 1px solid rgba(255, 255, 255, 0.35);
}


.hero-card__app-icon--placeholder2 {
  background-image: url("../tp/2.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  
  border: 1px solid rgba(255, 255, 255, 0.35);
}


.hero-card__app-icon--placeholder3 {
  background-image: url("../tp/7.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.hero-card__meta {
  flex: 1;
  min-width: 0;
}

.hero-card__app-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-card__app-cat {
  margin: 2px 0 0;
  font-size: 0.75rem;
  opacity: 0.85;
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 6px 16px;
  border: 1px solid transparent;
}

.btn--get {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.btn--open {
  background: #f2f2f7;
  color: var(--accent);
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 4px;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  padding: 0;
  background: #d1d1d6;
  border: none;
}

.carousel__dot--active {
  background: #636366;
  transform: scale(1.15);
}

.list-section {
  padding: 8px 0 20px;
}

.list-section + .list-section {
  padding-top: 0;
}

.section-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  text-align: left;
}

.section-head__title {
  font-size: 1.25rem;
  font-weight: 700;
}

.section-head__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #c7c7cc;
  border-bottom: 2px solid #c7c7cc;
  transform: rotate(-45deg);
  margin-right: 4px;
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0 20px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f7;
}

.app-row:last-child {
  border-bottom: none;
}

.app-row--ranked {
  gap: 10px;
}

.app-row__rank {
  flex: 0 0 22px;
  align-self: center;
  text-align: center;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.app-row__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-row__text {
  flex: 1;
  min-width: 0;
}

.app-row__name {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.app-row__desc {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.app-row__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.app-row__hint {
  font-size: 0.5625rem;
  color: var(--text-secondary);
  line-height: 1;
}

/* 列表里的「获取」：.btn--get 默认是给轮播深色底用的白字，在白底上会“消失” */
.app-row .btn--get {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent);
  border-color: rgba(0, 122, 255, 0.22);
}

.app-row .btn--update {
  background: #f2f2f7;
  color: var(--accent);
  border-color: transparent;
}

/* 底部留白 + 悬浮胶囊导航（对齐 App Store：外层磨砂白条 + 选中项实心浅灰底） */
.tabbar-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0));
}

.tabbar {
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px 9px;
  border-radius: 999px;
  /* 外层：更透的磨玻璃 */
  background: rgba(255, 255, 255, 0.48);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  backdrop-filter: saturate(180%) blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07), 0 2px 5px rgba(0, 0, 0, 0.04);
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px 4px;
  border-radius: 13px;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #1c1c1e;
}

.tab img {
  display: block;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* 未选中：图标接近纯黑（资源偏灰时压一下） */
.tab:not(.tab--active) img {
  opacity: 0.96;
  filter: contrast(1.08);
}

.tab--active {
  color: var(--accent);
  /* 直接使用图2资源贴底（assets/tab-active-bg.png） */
  background-color: transparent;
  background-image: url("../assets/tab-active-bg.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  border-radius: 999px;
  border: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (hover: hover) {
  .pill:hover,
  .tab:hover:not(.tab--active) {
    opacity: 0.92;
  }
}
