/* ==========================================================================
   iOS 侧载商店 · 视觉系统
   ----------------------------------------------------------------------
   设计取向：极简黑底 + 一束会呼吸的环境光。颜色只从「类目」来，
   除类目色之外不引入任何装饰性颜色，避免变成霓虹风的廉价感。
   动效一律走 transform / opacity，遵守 prefers-reduced-motion。
   ========================================================================== */

:root {
  --bg:        #07070A;
  --bg-soft:   #0C0C11;
  --text:      #F2F2F5;
  --text-2:    #A0A0AA;
  --text-3:    #6C6C78;
  --text-4:    #4A4A55;

  --glass:     rgba(255,255,255,.045);
  --glass-hi:  rgba(255,255,255,.075);
  --line:      rgba(255,255,255,.075);
  --line-hi:   rgba(255,255,255,.14);

  --accent:    #5E7CFF;
  --accent-2:  #8A5CFF;

  --ok:        #34D399;
  --warn:      #FBBF24;

  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --row-h: 78px;
  --pad-x: 40px;
  --maxw: 1280px;
  --topbar-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC",
          "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --ease: cubic-bezier(.22, .78, .22, 1);
  --spring: cubic-bezier(.2, 1.16, .3, 1);
}

* { box-sizing: border-box; }

/* 作者样式里的 display:grid 会盖掉 UA 的 [hidden]{display:none}，
   所以这里显式兜住，否则 .cmdk / .spot 之类的 hidden 会失效 */
[hidden] { display: none !important; }

/* 不设全局 scroll-behavior:smooth —— 它会让 window.scrollTo(0, y) 这种
   「恢复滚动位置」的调用也变成动画，从详情页返回时会看到一段缓慢滑动。
   需要平滑的地方（点品牌回到顶部）在 JS 里显式传 behavior。 */

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01";
}

body {
  overflow-x: hidden;
  min-height: 100vh;
}

button { font-family: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }

::selection { background: rgba(94,124,255,.35); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.11);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid rgba(120,145,255,.9);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ==========================================================================
   环境光
   ========================================================================== */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .85;
}
.aurora .blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.b1 {
  width: 62vw; height: 62vw;
  left: -14vw; top: -26vw;
  background: radial-gradient(circle, rgba(94,124,255,.34), transparent 68%);
  animation: drift1 34s ease-in-out infinite alternate;
}
.b2 {
  width: 54vw; height: 54vw;
  right: -16vw; top: -10vw;
  background: radial-gradient(circle, rgba(158,84,255,.26), transparent 70%);
  animation: drift2 42s ease-in-out infinite alternate;
}
.b3 {
  width: 70vw; height: 44vw;
  left: 18vw; top: 34vh;
  background: radial-gradient(circle, rgba(28,180,220,.14), transparent 72%);
  animation: drift3 50s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(7vw, 5vh, 0) scale(1.12); } }
@keyframes drift2 { to { transform: translate3d(-6vw, 8vh, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(-8vw, -6vh, 0) scale(1.16); } }

/* 遮罩：让极光在下半屏淡出，正文区域仍然够黑能读 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 0%, transparent 30%, rgba(7,7,10,.55) 68%, var(--bg) 100%),
    linear-gradient(to bottom, transparent 40vh, rgba(7,7,10,.82) 78vh, var(--bg) 100%);
}

/* ==========================================================================
   顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: rgba(7,7,10,.62);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.topbar.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(7,7,10,.82);
}

.topbar-in {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  transition: opacity .2s;
}
.brand:hover { opacity: .82; }

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6379FF, #8A5CFF 58%, #B14CFF);
  box-shadow: 0 4px 16px rgba(94,124,255,.42), inset 0 1px 0 rgba(255,255,255,.32);
}
.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13.5px; font-weight: 650; letter-spacing: -.1px; }
.brand-text i {
  font-size: 10.5px;
  font-style: normal;
  color: var(--text-3);
  letter-spacing: .3px;
}

/* 搜索：这里其实是个按钮，点开才是命令面板 */
.omni {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 430px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--text-3);
  transition: background .18s, border-color .18s, color .18s;
}
.omni:hover { background: var(--glass-hi); border-color: var(--line-hi); color: var(--text-2); }
.omni-ico { width: 14px; height: 14px; flex: none; }
.omni-ph {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}
.omni-kbd {
  flex: none;
  font-family: var(--font);
  font-size: 10.5px;
  color: var(--text-3);
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--line-hi);
  background: rgba(255,255,255,.03);
}

.live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
  box-shadow: 0 0 0 0 rgba(52,211,153,.5);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

.switch {
  flex: none;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.sw {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-3);
  transition: color .15s, background .15s;
  letter-spacing: .2px;
}
.sw:hover { color: var(--text-2); }
.sw.is-active { color: var(--text); background: rgba(255,255,255,.12); }

/* ==========================================================================
   页面容器
   ========================================================================== */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px var(--pad-x) 90px;
}

/* ==========================================================================
   Spotlight 主推位
   ========================================================================== */
.spot { margin-bottom: 34px; }

.spot-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  background:
    radial-gradient(90% 130% at 88% 12%, var(--tint-a, rgba(94,124,255,.28)), transparent 58%),
    radial-gradient(80% 120% at 6% 92%, var(--tint-b, rgba(138,92,255,.16)), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 26px 70px -32px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.09);
  isolation: isolate;
}
/* 细网纹：让大面积色块不平，像磨砂玻璃而不是色卡 */
.spot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(120% 100% at 80% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 100% at 80% 0%, #000 10%, transparent 72%);
}

.spot-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  padding: 34px 36px;
  align-items: center;
}

/* 主推位标题行里的小图标：只在窄屏出现。桌面端右侧已有 156px 的大图标，
   窄屏把艺术区整个收掉后，标题旁边必须留一个锚点，否则用户看不出是哪个 App。 */
.spot-mini { display: none; }

.spot-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 16px;
}
.spot-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tint-s, #5E7CFF);
  box-shadow: 0 0 10px var(--tint-s, #5E7CFF);
}

.spot-name {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.04;
  margin: 0 0 12px;
  background: linear-gradient(180deg, #fff, #C9C9D4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.spot-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
  margin: 0 0 20px;
  max-width: 56ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spot-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 550;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  color: var(--text-2);
  white-space: nowrap;
}

.spot-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, #6B82FF, #8A5CFF);
  box-shadow: 0 8px 24px -8px rgba(110,110,255,.8), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .18s var(--spring), box-shadow .18s, filter .18s;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 30px -8px rgba(110,110,255,.95), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-primary:active { transform: scale(.975); }
.btn-primary svg { width: 15px; height: 15px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-hi);
  transition: background .16s, border-color .16s;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.24); }

/* 右侧：悬浮图标 + 光晕 */
.spot-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 300px;
}
.spot-glow {
  position: absolute;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: var(--tint-s, #5E7CFF);
  filter: blur(62px);
  opacity: .38;
  animation: breathe 5.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .34; }
  50%      { transform: scale(1.16); opacity: .5; }
}
.spot-ring {
  position: absolute;
  border-radius: 34%;
  border: 1px solid rgba(255,255,255,.1);
  width: 210px; height: 210px;
}
.spot-ring.r2 { width: 268px; height: 268px; border-color: rgba(255,255,255,.055); }
.spot-ring.r3 { width: 330px; height: 330px; border-color: rgba(255,255,255,.03); }

.spot-icon {
  position: relative;
  z-index: 2;
  width: 156px; height: 156px;
  border-radius: 36px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  box-shadow:
    0 30px 60px -18px rgba(0,0,0,.85),
    0 0 0 1px rgba(255,255,255,.14),
    inset 0 1px 0 rgba(255,255,255,.2);
  transform: rotate(-4deg);
  transition: transform .5s var(--spring);
}
.spot-card:hover .spot-icon { transform: rotate(0deg) scale(1.03); }
.spot-icon img { width: 100%; height: 100%; object-fit: cover; }

.spot-num {
  position: absolute;
  z-index: 3;
  bottom: 18px; right: 8px;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(12,12,17,.72);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: right;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.9);
}
.spot-num .n {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.spot-num .l { font-size: 10px; color: var(--text-3); letter-spacing: .3px; }

/* ==========================================================================
   数据条
   ========================================================================== */
.statline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 40px;
}
.stat {
  background: rgba(12,12,17,.72);
  padding: 16px 18px;
  transition: background .2s;
}
.stat:hover { background: rgba(22,22,30,.82); }
.stat .k {
  font-size: 10.5px;
  color: #8C8C97;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stat .v {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat .v small { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }

/* ==========================================================================
   货架
   ========================================================================== */
.shelf { margin-bottom: 42px; }

.shelf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.shelf-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.35px;
  margin: 0 0 3px;
}
.shelf-sub { font-size: 12px; color: var(--text-3); margin: 0; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 236px;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }

.card {
  position: relative;
  scroll-snap-align: start;
  text-align: left;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .22s var(--spring), border-color .22s, background .22s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 70% at 100% 0%, var(--tint-a, rgba(255,255,255,.08)), transparent 66%);
  opacity: .8;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,.2);
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
}
.card:active { transform: translateY(-1px) scale(.99); }

.card-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
/* 这些名字节点在 span 里，必须是块级才能吃到 ellipsis */
.card-name, .card-sub, .sim .nm, .sim .sb, .cm-item .nm, .cm-item .sb { display: block; }
.card-name {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.card-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.card-metric { color: var(--text-2); font-weight: 600; }

/* ==========================================================================
   榜单
   ========================================================================== */
.chart-section { position: relative; }

.chart-bar {
  position: sticky;
  top: calc(var(--topbar-h) + 0px);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  background: linear-gradient(to bottom, rgba(7,7,10,.96) 62%, rgba(7,7,10,.72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 1 auto;
  min-width: 0;
}
.segmented::-webkit-scrollbar { display: none; }

.seg {
  position: relative;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  border-radius: 8px;
  white-space: nowrap;
  transition: color .16s, background .16s;
  flex: none;
}
.seg:hover { color: var(--text-2); }
.seg.is-active {
  color: var(--text);
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.chart-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

.pills { display: flex; gap: 5px; }
.pill {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all .15s;
}
.pill:hover { color: var(--text-2); border-color: var(--line-hi); }
.pill.is-active {
  color: var(--text);
  background: rgba(255,255,255,.11);
  border-color: transparent;
}

/* 类目横条 */
.catrail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 14px 0 2px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
}
.catrail::-webkit-scrollbar { display: none; }

.cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255,255,255,.035);
  border: 1px solid transparent;
  white-space: nowrap;
  flex: none;
  transition: all .16s;
}
.cat:hover { background: rgba(255,255,255,.075); color: var(--text); }
.cat.is-active {
  color: var(--text);
  background: rgba(255,255,255,.1);
  border-color: var(--line-hi);
}
.cat .cb {
  width: 6px; height: 6px;
  border-radius: 2px;
  flex: none;
}
.cat .cn {
  font-size: 10.5px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.cat.is-active .cn { color: var(--text-3); }

.chart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 6px;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-height: 36px;
}
.chart-hint { color: var(--text-4); text-align: right; }

/* ---- 虚拟列表 ---- */
.chart {
  position: relative;
  contain: layout style;
}
.chart-sizer { position: relative; width: 100%; }

.row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--row-h);
  display: grid;
  grid-template-columns: 34px 56px minmax(0, 1fr) 96px 84px;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
  transition: background .16s;
  contain: layout paint style;
}
.row:hover { background: rgba(255,255,255,.045); }
/* 悬停不隐藏分隔线：行是绝对定位的，靠相邻兄弟选择器做分隔会在
   虚拟列表复用节点时错位，用每行自带的底边最稳。 */

/* 跟随光标的柔光：--mx/--my 由 JS 写入，不重建 DOM */
.row::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
  background: radial-gradient(220px 120px at var(--mx, 50%) var(--my, 50%),
              var(--tint-a, rgba(255,255,255,.1)), transparent 72%);
}
.row:hover::before { opacity: .85; }

.row.is-active { background: rgba(255,255,255,.05); }

.rank {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-4);
  text-align: center;
  font-variant-numeric: tabular-nums;
  position: relative;
  line-height: 1;
}
.row:hover .rank { color: var(--text-3); }
.rank .rk { display: block; }

/* 排名变化：只在本机有历史快照时出现 */
.rank-delta {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 3px;
  letter-spacing: -.2px;
}
.rank-delta.up { color: var(--ok); }
.rank-delta.down { color: #FF7A70; }

.ico {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex: none;
  background: rgba(255,255,255,.05);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 6px 16px -8px rgba(0,0,0,.9);
  display: grid;
  place-items: center;
  transition: transform .22s var(--spring);
}
.row:hover .ico { transform: scale(1.06); }
.ico img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .38s var(--ease);
}
.ico img.is-loaded { opacity: 1; }
.ico .ini {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.5px;
  color: #fff;
  background: var(--tint-s, #333);
  z-index: 0;
}
/* 头像没加载完时盖一层微光，避免出现色块跳变 */
.ico .skel {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(100deg, rgba(255,255,255,.02) 20%, rgba(255,255,255,.09) 42%, rgba(255,255,255,.02) 64%);
  background-size: 220% 100%;
  animation: skim 1.4s linear infinite;
  pointer-events: none;
}
@keyframes skim { to { background-position: -220% 0; } }
.ico.done .skel { display: none; }

.ico.sm { width: 46px; height: 46px; border-radius: 12px; }
.ico.sm .ini { font-size: 14px; }
.ico.lg { width: 116px; height: 116px; border-radius: 27px; }
.ico.lg .ini { font-size: 36px; }

.row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.row-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.row-name b {
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

.tagb {
  flex: none;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .1px;
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tagb.unsigned { color: #8FC0FF; background: rgba(94,124,255,.14); border-color: rgba(94,124,255,.28); }
.tagb.trollstore { color: #6EE7B7; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.26); }
.tagb.fresh { color: #FCD34D; background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.24); }

/* 这一行必须放在块级盒子里：flex 容器的子项不参与 text-overflow，
   窄屏会看到「1,148 downt」被硬砍一半而不是省略号。 */
.row-sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub .sep { color: var(--text-4); margin: 0 5px; }
.row-sub .em { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 第三行放简介。列表在 1440 宽下右半边会有大片空白，
   这一行既填了版面，也是唯一能让人不点进去就判断「这干嘛的」的信息。 */
.row-desc {
  font-size: 11.5px;
  color: #7A7A87;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.row-ver {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.row-ver span { display: block; color: var(--text-4); font-size: 10.5px; }

.get {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 14px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  color: #CFD8FF;
  background: rgba(94,124,255,.16);
  white-space: nowrap;
  transition: background .16s, color .16s, transform .16s;
}
.row:hover .get { background: rgba(94,124,255,.34); color: #fff; }
.row:active .get { transform: scale(.95); }

/* 骨架 */
.sk-row {
  height: var(--row-h);
  display: grid;
  grid-template-columns: 34px 56px minmax(0,1fr) 96px 84px;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  margin: 0 -14px;
}
.sk {
  background: linear-gradient(100deg, rgba(255,255,255,.028) 20%, rgba(255,255,255,.07) 42%, rgba(255,255,255,.028) 64%);
  background-size: 220% 100%;
  animation: skim 1.5s linear infinite;
  border-radius: 6px;
}
.sk.sq { width: 56px; height: 56px; border-radius: 14px; }
.sk.ln { height: 10px; }
.sk.ln.w1 { width: 42%; }
.sk.ln.w2 { width: 68%; }

/* 滚动到底的收尾 */
.chart-end {
  padding: 26px 0 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-4);
  letter-spacing: .3px;
}

/* 空态 */
.empty { padding: 78px 0 40px; text-align: center; }
.empty-mark {
  width: 46px; height: 46px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--text-4);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.empty-mark svg { width: 20px; height: 20px; }
.empty-title { font-size: 15px; font-weight: 650; }
.empty-sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.ghost-btn {
  margin-top: 18px;
  height: 32px;
  padding: 0 16px;
  border-radius: 99px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--line-hi);
  transition: all .16s;
}
.ghost-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }

/* ==========================================================================
   详情页
   ========================================================================== */
.detail {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px var(--pad-x) 100px;
}
.detail.is-in { animation: viewIn .42s var(--ease) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px) scale(.994); }
  to   { opacity: 1; transform: none; }
}

.d-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px 0 11px;
  border-radius: 99px;
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  margin-bottom: 22px;
  transition: all .16s;
}
.d-back:hover { color: var(--text); background: rgba(255,255,255,.09); }
.d-back svg { width: 13px; height: 13px; }

/* 渐变头图 */
.d-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(100% 160% at 85% -10%, var(--tint-a, rgba(94,124,255,.3)), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.012));
  margin-bottom: 18px;
}
.d-hero-in {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 28px 30px;
}
.d-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tint-s, var(--accent));
  margin-bottom: 8px;
}
.d-name {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 740;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 0 0 7px;
}
.d-owner { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-owner a { color: var(--text-2); border-bottom: 1px solid var(--line-hi); padding-bottom: 1px; }
.d-owner a:hover { color: var(--text); border-color: var(--text-3); }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.d-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.d-cta .meta { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }

/* 统计 */
.d-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 30px;
}
.d-stats .stat { background: rgba(12,12,17,.7); padding: 15px 18px; }

/* ==========================================================================
   运行截图
   --------------------------------------------------------------------------
   一排定高的横向滑轨，卡片宽度由图片自身长宽比决定：竖版手机截图自然变窄，
   横版演示图自动变宽，不需要给每种比例写一套尺寸。
   加载前先铺 14px 的 WebP 糊图（--ph），这是「颜色先到、细节后到」，
   比灰块骨架更接近最终画面，也不会在滚动时闪一片空白。
   ========================================================================== */
.shots { margin-bottom: 30px; }
.shots-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.shots-head .d-h { margin: 0; }
.shots-nav { display: flex; gap: 6px; flex: none; }
.shots-nav button {
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 99px;
  color: var(--text-3);
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  transition: color .16s, background .16s, opacity .16s;
}
.shots-nav button:hover { color: var(--text); background: rgba(255,255,255,.1); }
.shots-nav button:disabled { opacity: .28; cursor: default; }
.shots-nav svg { width: 12px; height: 12px; }

.shots-rail {
  display: flex;
  gap: 12px;
  /* 上下留 2px / 6px 给 hover 抬升和阴影；高度要把内边距算进来，
     这样卡片 height:100% 才等于 JS 里 width calc 用的 --shot-h */
  height: calc(var(--shot-h, 372px) + 8px);
  /* 往两侧出血到容器边缘：卡片能划出视野，暗示「还有更多」 */
  margin: 0 calc(var(--pad-x) * -1);
  padding: 2px var(--pad-x) 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  /* 不给 scroll-padding 的话，snap 会把第一张卡吸到「内边距外沿」，
     于是窄屏上首图会比标题左移一个 --pad-x，看着像没对齐 */
  scroll-padding-left: var(--pad-x);
  scroll-padding-right: var(--pad-x);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.shots-rail::-webkit-scrollbar { display: none; }

.shot {
  position: relative;
  flex: 0 0 auto;
  height: 100%;
  max-width: 440px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-hi);
  background-color: var(--bg-soft);
  background-image: var(--ph, none);
  background-size: cover;
  background-position: center;
  scroll-snap-align: start;
  cursor: zoom-in;
  transition: transform .3s var(--ease), border-color .2s, box-shadow .3s;
}
.shot::after {
  /* 内侧 1px 高光 + 顶部反光，让卡片看起来是块玻璃而不是贴纸 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.04);
  pointer-events: none;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.shot img.is-loaded { opacity: 1; transform: none; }
/* 横图（iPad / Mac 界面）：限宽 + 完整显示。裁掉两边就看不到界面结构了，
   宁可在卡片里留上下黑边 */
.shot.wide { max-width: 430px; background-image: none; background-color: #0A0A0F; }
.shot.wide img { object-fit: contain; }
.shot:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.24);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.9);
}
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 没有截图的仓库：留一条低调的说明，而不是空一块 */
.shots-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-hi);
  font-size: 12px;
  color: var(--text-3);
  transition: color .16s, border-color .16s, background .16s;
}
.shots-empty:hover { color: var(--text-2); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.025); }
.shots-empty svg { width: 15px; height: 15px; flex: none; color: var(--text-4); }
.shots-empty .arrow { margin-left: auto; width: 13px; height: 13px; }

/* 大图查看 */
.lbx {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  background: rgba(4,4,7,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.lbx.in { opacity: 1; }
.lbx-img {
  max-width: min(94vw, 620px);
  max-height: 88vh;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 40px 90px -30px #000;
  transform: scale(.97);
  transition: transform .3s var(--spring);
}
.lbx.in .lbx-img { transform: none; }
.lbx-x, .lbx-p, .lbx-n {
  position: absolute;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 99px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line-hi);
  backdrop-filter: blur(8px);
  transition: background .16s, opacity .16s;
}
.lbx-x:hover, .lbx-p:hover, .lbx-n:hover { background: rgba(255,255,255,.16); }
.lbx-x { top: 20px; right: 20px; }
.lbx-p { left: 18px; top: 50%; margin-top: -19px; }
.lbx-n { right: 18px; top: 50%; margin-top: -19px; }
.lbx-p:disabled, .lbx-n:disabled { opacity: 0; pointer-events: none; }
.lbx svg { width: 16px; height: 16px; }
.lbx-cap {
  position: absolute;
  bottom: 22px; left: 0; right: 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}


/* 内容网格：左正文 右侧栏 */
.d-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 40px;
  align-items: start;
}

.d-block { margin-bottom: 34px; }
.d-block:last-child { margin-bottom: 0; }
.d-h {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 14px;
  font-weight: 680;
  letter-spacing: -.2px;
  margin: 0 0 12px;
}
.d-h .muted { font-size: 11px; font-weight: 400; color: var(--text-4); letter-spacing: 0; }

.d-desc {
  font-size: 13.5px;
  line-height: 1.8;
  color: #BFBFC9;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 安装步骤 */
.steps { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 17px;
  background: rgba(12,12,17,.7);
}
.step-n {
  flex: none;
  width: 21px; height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(94,124,255,.28);
  border: 1px solid rgba(94,124,255,.4);
  margin-top: 1px;
}
.step-t { font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.step-t b { color: var(--text); font-weight: 620; }

/* 安装包表 */
.pkgs { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.pkg {
  display: grid;
  grid-template-columns: minmax(0,1fr) 72px 72px 60px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.pkg:last-child { border-bottom: none; }
.pkg:hover { background: rgba(255,255,255,.032); }
.pkg .fn {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pkg .n { color: var(--text-3); font-variant-numeric: tabular-nums; text-align: right; }
.pkg .go {
  justify-self: end;
  font-size: 11px;
  font-weight: 650;
  color: #C7D2FF;
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(94,124,255,.15);
  transition: background .15s;
}
.pkg .go:hover { background: rgba(94,124,255,.32); color: #fff; }

/* 版本时间线 */
.tl { position: relative; padding-left: 18px; }
.tl::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line-hi), transparent);
}
.tl-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  font-size: 12.5px;
}
.tl-item::before {
  content: "";
  position: absolute;
  left: -18px; top: 13px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--text-4);
}
.tl-item:first-child::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 9px rgba(94,124,255,.8); }
.tl-tag { font-weight: 620; font-variant-numeric: tabular-nums; color: var(--text); }
.tl-date { color: var(--text-4); font-variant-numeric: tabular-nums; }
.tl-n { margin-left: auto; color: var(--text-4); font-size: 11px; }
.tl-go { font-size: 11px; color: var(--text-3); }
.tl-go:hover { color: var(--accent); }

/* 侧栏：安装卡 */
.aside-card {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  padding: 18px;
  margin-bottom: 16px;
}
.aside-h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.aside-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.aside-row:last-child { border-bottom: none; }
.aside-row .k { color: var(--text-3); }
.aside-row .v { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.aside-note {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-3);
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: rgba(251,191,36,.055);
  border: 1px solid rgba(251,191,36,.16);
}
.aside-note.ok { background: rgba(52,211,153,.055); border-color: rgba(52,211,153,.18); }

/* 同类推荐 */
.sim-list { display: flex; flex-direction: column; gap: 2px; }
.sim {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background .15s;
}
.sim:hover { background: rgba(255,255,255,.05); }
.sim .nm { font-size: 12.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim .sb { font-size: 10.5px; color: var(--text-4); }

.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  color: var(--text-3);
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}

/* ==========================================================================
   命令面板
   ========================================================================== */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: start center;
  padding-top: min(16vh, 140px);
}
.cmdk-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4,4,7,.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }

.cmdk-box {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  border-radius: 18px;
  background: rgba(18,18,24,.9);
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 40px 100px -24px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.09);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  overflow: hidden;
  animation: cmdIn .3s var(--spring) both;
}
@keyframes cmdIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.cmdk-in {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}
.cmdk-ico { width: 16px; height: 16px; color: var(--text-3); flex: none; }
#cmdkInput {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
#cmdkInput::placeholder { color: var(--text-4); }
.cmdk-in kbd, .cmdk-foot kbd {
  font-family: var(--font);
  font-size: 10px;
  color: var(--text-4);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-hi);
  flex: none;
}

.cmdk-list {
  max-height: min(46vh, 400px);
  overflow-y: auto;
  padding: 7px;
  overscroll-behavior: contain;
}
.cm-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  text-align: left;
  transition: background .1s;
}
.cm-item[aria-selected="true"] { background: rgba(94,124,255,.2); }
.cm-item .nm { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-item .sb { font-size: 11px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-item .right { margin-left: auto; font-size: 10.5px; color: var(--text-4); flex: none; font-variant-numeric: tabular-nums; }
.cm-empty { padding: 30px 16px; text-align: center; font-size: 12.5px; color: var(--text-4); }

.cmdk-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--text-4);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-count { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   页脚
   ========================================================================== */
.foot {
  margin-top: 20px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-4);
}
.foot-l { display: flex; align-items: center; gap: 8px; }
.foot-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.foot a { color: var(--text-3); }
.foot a:hover { color: var(--text-2); }

/* ==========================================================================
   Toast
   ========================================================================== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 99px;
  background: rgba(22,22,28,.92);
  border: 1px solid var(--line-hi);
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: 0 16px 44px -12px rgba(0,0,0,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .28s ease, transform .38s var(--spring);
}
#toast.is-in { opacity: 1; transform: translate(-50%, 0); }
#toast::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 9px rgba(52,211,153,.8);
}
#toast:empty { display: none; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  :root { --pad-x: 26px; }
  .shots-rail { --shot-h: 320px; }
  .spot-grid { grid-template-columns: minmax(0,1fr) 270px; padding: 28px; }
  .spot-art { height: 250px; }
  .spot-icon { width: 124px; height: 124px; border-radius: 30px; }
  .spot-ring { width: 176px; height: 176px; }
  .spot-ring.r2 { width: 222px; height: 222px; }
  .spot-ring.r3 { display: none; }
  .d-grid { grid-template-columns: minmax(0,1fr); gap: 28px; }
  .aside-card { position: static; }
}

@media (max-width: 860px) {
  .statline { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shots-rail { --shot-h: 300px; }
  .spot-grid { grid-template-columns: minmax(0,1fr); padding: 26px 22px; }
  .spot-art { display: none; }
  .spot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .spot-mini { display: block; flex: none; }
  .spot-mini .ico { width: 44px; height: 44px; border-radius: 12px; }
  .spot-eyebrow { margin-bottom: 0; }
  .brand-text i { display: none; }
  .live { display: none; }
}

@media (max-width: 720px) {
  :root {
    --pad-x: 17px;
    --topbar-h: 58px;
    --row-h: 72px;
  }
  /* 手机上截图轨道要能「划出去」，高度收到拇指够得着的范围 */
  .shots-rail { --shot-h: 268px; gap: 9px; }
  .shots-nav { display: none; }
  .shot { border-radius: 14px; max-width: 78vw; }
  .lbx-p { left: 8px; }
  .lbx-n { right: 8px; }

  .topbar-in { gap: 10px; }
  .brand-text { display: none; }
  .omni { max-width: none; }
  .omni-ph { font-size: 12.5px; }
  .omni-kbd { display: none; }

  .page { padding-top: 18px; }

  .spot-card { border-radius: 22px; }
  .spot-grid { padding: 22px 20px; gap: 0; }
  .spot-name { font-size: 27px; margin-bottom: 9px; }
  .spot-desc { font-size: 12.5px; -webkit-line-clamp: 2; margin-bottom: 16px; }
  .spot-chips { margin-bottom: 18px; }
  .spot-actions { gap: 8px; }
  .btn-primary, .btn-ghost { height: 36px; font-size: 12.5px; padding: 0 16px; }

  .statline { margin-bottom: 30px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 17px; }
  .stat .k { font-size: 9.5px; letter-spacing: .5px; }

  .shelf { margin-bottom: 30px; }
  .shelf-title { font-size: 16.5px; }
  .shelf-sub { font-size: 11px; }
  .rail { grid-auto-columns: 200px; }

  /* 排序栏在窄屏改为两行：排序一行、筛选一行 */
  .chart-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    top: calc(var(--topbar-h) - 1px);
  }
  .segmented { width: 100%; order: 1; }
  /* 六种排序在 356px 里放不下，横滑是唯一解；末端加渐隐，
     让「还有内容」这件事一眼可见，而不是被硬切一半。 */
  .segmented {
    mask-image: linear-gradient(to right, #000 88%, transparent);
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .chart-tools { order: 2; margin-left: 0; width: 100%; }
  .pills { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }

  .catrail { padding: 10px 0 2px; }
  .chart-line { padding: 10px 2px 4px; font-size: 11px; }
  .chart-hint { display: none; }

  /* 窄屏：隐藏版本列与描述，保留信息骨架 */
  .row {
    grid-template-columns: 22px 50px minmax(0, 1fr) 62px;
    gap: 10px;
    padding: 0 10px;
    margin: 0 -10px;
  }
  .row .row-ver { display: none; }
  .row-desc { display: none; }
  /* 窄屏一行只够「名字 + 安装方式 + 获取」。「N 包」是次要信息，
     留着会把名字挤成 "OpenPa…"，所以让位。 */
  .row .tagb.fresh { display: none; }
  .row-name b { font-size: 14px; }
  .ico { width: 50px; height: 50px; border-radius: 13px; }
  .row-sub .hide-sm { display: none; }
  .get { padding: 0 11px; height: 26px; font-size: 11px; }
  .sk-row { grid-template-columns: 22px 50px minmax(0,1fr) 62px; gap: 10px; padding: 0 10px; margin: 0 -10px; }

  .d-hero-in { grid-template-columns: 78px minmax(0,1fr); gap: 16px; padding: 20px; }
  .ico.lg { width: 78px; height: 78px; border-radius: 19px; }
  .ico.lg .ini { font-size: 24px; }
  .d-cta { grid-column: 1 / -1; align-items: stretch; }
  .d-cta .btn-primary { justify-content: center; width: 100%; }
  .d-cta .meta { text-align: center; }
  .d-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .d-name { font-size: 23px; }

  .pkg { grid-template-columns: minmax(0,1fr) 56px; row-gap: 4px; }
  .pkg .n:nth-child(3) { display: none; }
  .pkg .go { grid-row: 1 / 3; }

  .cmdk { padding-top: 8vh; }
  #cmdkInput { font-size: 16px; }  /* 低于 16px 时 iOS 会自动放大页面 */
}

@media (max-width: 380px) {
  .rail { grid-auto-columns: 176px; }
  .spot-name { font-size: 24px; }
}

/* ==========================================================================
   无障碍
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora .blob { animation: none; }
  .pulse { animation: none; }
  .spot-glow { animation: none; }
  .sk, .ico .skel { animation: none; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .row::before { display: none; }
}
