/**
 * radar_strip - 雷达速览条
 * 横向滚动 + scroll-snap + 左右箭头 + 边缘渐隐
 * 使用主题 CSS 变量，自动跟随浅色 / 暗色模式
 */

.radar-strip {
  margin-bottom: 14px;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: 16px 0 16px 18px;
}

/* ---------- 标题栏（统一规格，同主题 .widget-title） ---------- */

.radar-strip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0 18px 10px 0;
  border-bottom: 2px solid var(--border-primary);
}

.radar-strip__head-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.radar-strip__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
}

.radar-strip__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-strip__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.radar-strip__more:hover {
  color: var(--color-link);
}

.radar-strip__more svg {
  transition: transform 0.25s ease;
}

.radar-strip__more:hover svg {
  transform: translateX(3px);
}

/* ---------- 滚动区 ---------- */

.radar-strip__wrap {
  position: relative;
}

.radar-strip__scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 18px 6px 0;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  outline: none;
}

.radar-strip__scroller::-webkit-scrollbar {
  display: none;
}

/* 边缘渐隐：左侧仅在可向前滚动时出现 */
.radar-strip__wrap::before,
.radar-strip__wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 6px;
  width: 34px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.radar-strip__wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-card) 12%, transparent 100%);
}

.radar-strip__wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-card) 12%, transparent 100%);
}

.radar-strip.can-prev .radar-strip__wrap::before,
.radar-strip.can-next .radar-strip__wrap::after {
  opacity: 1;
}

/* ---------- 卡片 ---------- */

.radar-strip__card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: var(--rs-card-w, 220px);
  min-height: 104px;
  padding: 12px 13px 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.radar-strip__card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--theme-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

a.radar-strip__card:hover {
  border-color: var(--theme-color);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

a.radar-strip__card:hover::after {
  opacity: 1;
}

.radar-strip__card--plain {
  cursor: default;
}

.radar-strip__card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 18px;
}

.radar-strip__date {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.radar-strip__tag {
  flex-shrink: 1;
  min-width: 0;
  padding: 1px 7px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-hover);
  color: var(--theme-color);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88px;
}

.radar-strip__card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-content);
  transition: color 0.2s ease;
}

a.radar-strip__card:hover .radar-strip__card-title {
  color: var(--color-link);
}

.radar-strip__card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 8px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

a.radar-strip__card:hover .radar-strip__card-foot {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- 箭头 ---------- */

.radar-strip__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.radar-strip__arrow--prev {
  left: 4px;
}

.radar-strip__arrow--next {
  right: 10px;
}

.radar-strip.can-prev .radar-strip__arrow--prev,
.radar-strip.can-next .radar-strip__arrow--next {
  opacity: 1;
  pointer-events: auto;
}

.radar-strip__arrow:hover {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

/* ---------- 响应式 ---------- */

@container (max-width: 620px) {
  .radar-strip {
    padding-left: 14px;
  }

  .radar-strip__head {
    padding-right: 14px;
  }

  .radar-strip__scroller {
    padding-right: 14px;
    gap: 10px;
  }

  .radar-strip__card {
    width: 180px;
    min-height: 96px;
  }
}

@media (max-width: 768px) {
  .radar-strip {
    padding: 14px 0 14px 14px;
  }

  .radar-strip__head {
    padding-right: 14px;
    margin-bottom: 12px;
  }

  .radar-strip__scroller {
    padding-right: 14px;
    gap: 10px;
  }

  .radar-strip__card {
    width: 170px;
    min-height: 96px;
    padding: 11px 12px 9px;
  }

  .radar-strip__title {
    font-size: 15px;
  }

  .radar-strip__arrow {
    display: none;
  }
}
