/* 首页开发现场 · 顶部热度条
   —— 左侧「当前有 N 个项目正在开发」真实计数胶囊，右侧项目橱窗滚动条。
   与首页同一套浅色语言：白底、极浅描边、低浓度柔光、全胶囊形；只作用于本组件，
   不覆盖下方创建卡与营销区。触控目标 ≥ 32px，键盘可展开/收起，尊重减少动画偏好。 */

.home-pulse {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--ai-stage, 720px);
  min-height: 36px;
  margin: 0 auto clamp(14px, 2.4vh, 26px);
  padding: 0 2px;
}

/* 加载骨架：与最终胶囊同高，避免加载完成时首屏内容跳动 */
.home-pulse-skeleton {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.home-pulse-skeleton span {
  display: block;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4f2fb 25%, #fbfaff 37%, #f4f2fb 63%);
  background-size: 400% 100%;
  animation: hp-shimmer 1.8s ease-in-out infinite;
}
.home-pulse-skeleton span:first-child { width: 218px; }
.home-pulse-skeleton span:last-child { width: 190px; margin-left: auto; }
@keyframes hp-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 左：真实开发数 */
.hp-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 14px 6px 11px;
  border: 1px solid rgba(106, 90, 224, .13);
  border-radius: 999px;
  color: #4c4f66;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(247, 245, 255, .92));
  box-shadow: 0 10px 24px -22px rgba(74, 60, 170, .55);
  font-size: 13px;
  line-height: 1.4;
}
.hp-live-dot {
  position: relative;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6a5ae0;
  box-shadow: 0 0 0 3px rgba(106, 90, 224, .12);
}
.hp-live-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(106, 90, 224, .42);
  animation: hp-ping 2.6s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes hp-ping {
  0% { transform: scale(1); opacity: .7; }
  70%, 100% { transform: scale(2.4); opacity: 0; }
}
.hp-live-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hp-live b {
  margin: 0 2px;
  color: #5a4bd6;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* 右：项目橱窗 */
.hp-ticker {
  position: relative;
  margin-left: auto;
  min-width: 0;
}
.hp-ticker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(340px, 46vw);
  padding: 6px 12px 6px 10px;
  border: 1px solid #ecebf6;
  border-radius: 999px;
  color: #2b2f45;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px -22px rgba(52, 43, 110, .55);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.hp-ticker-trigger:hover {
  border-color: #ded9f4;
  background: #fff;
}
.hp-ticker-trigger:focus-visible {
  outline: 2px solid #8b7ef0;
  outline-offset: 2px;
}
.hp-ticker.is-open .hp-ticker-trigger {
  border-color: #cfc8f2;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(106, 89, 232, .07), 0 12px 28px -24px rgba(52, 43, 110, .5);
}
.hp-ticker-live {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #36a179;
  box-shadow: 0 0 0 3px rgba(54, 161, 121, .12);
}
.hp-ticker-body {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.hp-ticker-name {
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #2b2f45;
  font-weight: 600;
}
.hp-ticker-tag {
  max-width: 118px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #8d90a6;
  font-size: 12px;
}
.hp-ticker-caret {
  flex: 0 0 auto;
  color: #9a97b4 !important;
  transition: transform .2s ease;
}
.hp-ticker-caret.is-open { transform: rotate(180deg); }

/* 轮换文字的淡入上移 */
.hp-swap-enter-active,
.hp-swap-leave-active {
  transition: opacity .26s ease, transform .26s ease;
}
.hp-swap-enter { opacity: 0; transform: translateY(6px); }
.hp-swap-leave-to { opacity: 0; transform: translateY(-6px); }

/* 下拉面板：磨砂玻璃 + 大圆角 + 柔和投影 */
.hp-ticker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  width: min(372px, 86vw);
  padding: 8px;
  border: 1px solid rgba(236, 235, 246, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    0 2px 8px -6px rgba(40, 32, 96, .18),
    0 26px 64px -36px rgba(40, 32, 96, .5);
}
.hp-ticker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* 条目可能渲染为 <a>（直接跳转）或 <button>（弹二维码 / 未上线提示），统一外观 */
.hp-ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 14px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background .18s ease;
}
.hp-ticker-item:hover {
  background: rgba(106, 90, 224, .07);
}
.hp-ticker-item:focus-visible {
  outline: 2px solid #8b7ef0;
  outline-offset: -2px;
  background: rgba(106, 90, 224, .07);
}
/* 未正式发布上线的小程序：不可预览，只给提示 */
.hp-ticker-item.is-locked { cursor: not-allowed; }
.hp-ticker-item.is-locked .hp-ticker-item-name { color: #6f7288; }
.hp-ticker-item.is-locked:hover { background: rgba(154, 151, 180, .1); }
.hp-ticker-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #6a5ae0;
  background: rgba(106, 90, 224, .09);
  font-size: 11px;
  font-weight: 700;
}
.hp-ticker-item-icon { flex: 0 0 auto; color: #8b87a6 !important; }
.hp-ticker-item-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.hp-ticker-item-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #262a40;
  font-size: 13px;
  font-weight: 600;
}
.hp-ticker-item-text small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  color: #8d90a6;
  font-size: 12px;
}
.hp-ticker-item-text small span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-ticker-release {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  color: #2f8f6b;
  background: rgba(54, 161, 121, .12);
  font-size: 11px;
  font-weight: 600;
}
.hp-ticker-flag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  color: #85839b;
  background: #f1f0f7;
  font-size: 11px;
  font-weight: 600;
}
.hp-ticker-item-arrow { flex: 0 0 auto; color: #b3b1c6 !important; }
.hp-ticker-foot {
  margin: 6px 6px 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(236, 235, 246, .9);
  color: #9a97b4;
  font-size: 11.5px;
  text-align: center;
}

/* 面板展开 */
.hp-drop-enter-active,
.hp-drop-leave-active {
  transition: opacity .2s ease, transform .2s ease;
}
.hp-drop-enter,
.hp-drop-leave-to {
  opacity: 0;
  transform: translateY(-6px) scale(.98);
}

/* 手机端：计数与橱窗分两行，橱窗占满整宽，条目名称优先完整可读 */
@media (max-width: 600px) {
  .home-pulse {
    max-width: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .hp-live { max-width: 100%; font-size: 12.5px; }
  .hp-ticker {
    width: 100%;
    margin-left: 0;
  }
  .hp-ticker-trigger {
    width: 100%;
    max-width: none;
    justify-content: space-between;
    padding: 8px 12px;
  }
  .hp-ticker-body { flex: 1; }
  .hp-ticker-name { max-width: none; }
  .hp-ticker-tag { display: none; }
  .hp-ticker-panel {
    left: 0;
    right: 0;
    width: 100%;
  }
  .hp-ticker-flag { display: none; }
}

/* 触控设备：保证触控目标高度 */
@media (hover: none) {
  .hp-ticker-trigger { min-height: 34px; }
  .hp-ticker-item { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-pulse-skeleton span { animation: none; }
  .hp-live-dot::after { animation: none; opacity: .35; }
  .hp-swap-enter-active,
  .hp-swap-leave-active,
  .hp-drop-enter-active,
  .hp-drop-leave-active,
  .hp-ticker-trigger,
  .hp-ticker-caret { transition: none; }
}

@media (forced-colors: active) {
  .hp-live,
  .hp-ticker-trigger,
  .hp-ticker-panel { border: 1px solid CanvasText; background: Canvas; }
  .hp-live-dot,
  .hp-ticker-live { background: CanvasText; }
}
