/* InvestDesk 全球指数跑马灯 — 挂于 topnav 下方
   依赖 design-system.css 的 --id-* 令牌（在其后加载） */

.id-ticker[hidden] { display: none; }

.id-ticker {
  position: relative;
  height: 40px;
  background: rgb(13 17 23 / 96%);
  border-bottom: 1px solid var(--id-border, #344153);
  overflow: hidden;
}

.id-ticker-viewport {
  height: 100%;
  overflow: hidden;
  /* 首尾淡入淡出遮罩 */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.id-ticker-track {
  display: inline-flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
  animation: id-ticker-scroll 80s linear infinite;
}

/* 悬停暂停 */
.id-ticker:hover .id-ticker-track { animation-play-state: paused; }

@keyframes id-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.id-tk-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 22px;
  font-size: 13px;
  line-height: 1;
  color: var(--id-text, #e6edf3);
}

.id-tk-tag {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--id-accent, #f0883e);
  background: rgb(240 136 62 / 10%);
  border: 1px solid rgb(240 136 62 / 24%);
  border-radius: 999px;
  padding: 2px 7px;
}

.id-tk-name { color: var(--id-muted, #a4b0bf); }

.id-tk-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.id-tk-chg { font-weight: 600; font-variant-numeric: tabular-nums; }
.id-tk-chg.up   { color: var(--id-negative, #ff827b); } /* 红涨 */
.id-tk-chg.down { color: var(--id-positive, #57c785); } /* 绿跌 */
.id-tk-chg.flat { color: var(--id-muted, #a4b0bf); }

/* 分隔小圆点（每个条目尾部） */
.id-tk-item::after {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--id-border, #344153);
  margin-left: 22px;
  margin-right: -22px;
}

/* H5 适配：缩小字号与高度，390px 无横向滚动（overflow hidden 保证） */
@media (max-width: 768px) {
  .id-ticker { height: 34px; }
  .id-tk-item { font-size: 12px; padding: 0 14px; gap: 5px; }
  .id-tk-tag { font-size: 9px; padding: 1px 6px; }
  .id-tk-item::after { margin-left: 14px; margin-right: -14px; }
  .id-ticker-viewport {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  }
}

/* 减少动态偏好：不滚动，允许手动横滑 */
@media (prefers-reduced-motion: reduce) {
  .id-ticker-track { animation: none; }
  .id-ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}
