/* ============================================================
   components/card.css — 通用卡片 / KPI 指标卡 / 指数条目卡
   依赖：tokens.css
   说明：沿用 .card / .kpi* / .kpi-link* 类名，便于 v2 页面零改动切换。
   ============================================================ */

/* ---- 通用卡片 ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card--hover:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-2);
}
.card__body { padding: var(--space-4); }
.card__title {
  font-family: var(--f-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
}

/* 左侧细橙强调线（沿用既有视觉） */
.accent-bar {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--brand);
  flex-shrink: 0;
}

/* ---- KPI 网格 ---- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.kpi-strip.secondary,
.kpi-strip.is-secondary {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1023px) { .kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .kpi-strip, .kpi-strip.is-secondary { grid-template-columns: repeat(2, 1fr); } }

/* ---- KPI 指标卡 ---- */
.kpi {
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--space-4);
}
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.kpi-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}
.kpi-ticker {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}
.kpi-value {
  font-family: var(--f-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-1);
}
.kpi-change {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
}
.kpi-change.is-up   { color: var(--up); }
.kpi-change.is-down { color: var(--down); }
.kpi-change.is-zero { color: var(--text-muted); }

/* ---- 指数条目卡（带序号圆点） ---- */
.kpi-link {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}
.kpi-link-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.kpi-link:hover .kpi-link-num {
  background: var(--brand);
  color: var(--text-inverse);
}
.kpi-link-body { flex: 1; min-width: 0; }
.kpi-link-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}
.kpi-link-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--text-muted);
  opacity: .8;
}

/* ---- 交错入场动画（沿用 v2 节奏） ---- */
.kpi-strip > *:nth-child(1) { animation: rise .5s var(--ease) both; animation-delay: .00s; }
.kpi-strip > *:nth-child(2) { animation: rise .5s var(--ease) both; animation-delay: .06s; }
.kpi-strip > *:nth-child(3) { animation: rise .5s var(--ease) both; animation-delay: .12s; }
.kpi-strip > *:nth-child(4) { animation: rise .5s var(--ease) both; animation-delay: .18s; }
.kpi-strip > *:nth-child(5) { animation: rise .5s var(--ease) both; animation-delay: .24s; }
.kpi-strip > *:nth-child(6) { animation: rise .5s var(--ease) both; animation-delay: .30s; }
.kpi-strip > *:nth-child(7) { animation: rise .5s var(--ease) both; animation-delay: .36s; }
.kpi-strip > *:nth-child(8) { animation: rise .5s var(--ease) both; animation-delay: .42s; }
