/* =========================================================
   最新活动页（newestactivity.html）专属样式
   由 common/header.html 引入；仅本页使用的类，避免全局污染。
   方框元素直角化；圆形元素（.icon-wrap 等）保持 50% 豁免。

   类名约定：hero/tabs/tab/content/btn/empty-hint/anim 等通用词加 na- 前缀；
   .activity-* 系列为活动页专属，原样保留（与插件 view 渲染类名一致）。
   ========================================================= */

/* ========== 顶部 Hero 区 ========== */
.na-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 90% 40%, rgba(186, 211, 255, 0.55) 0%, rgba(186, 211, 255, 0) 60%),
    radial-gradient(900px 500px at 15% 110%, rgba(219, 234, 254, 0.7) 0%, rgba(219, 234, 254, 0) 60%),
    linear-gradient(180deg, #eaf2ff 0%, #f5f9ff 100%);
}
.na-hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  z-index: 2;
}
.na-hero-text h1 {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 16px;
  color: #0f172a;
  line-height: 1.1;
}
.na-hero-text p.sub {
  font-size: 16px;
  color: #475569;
  margin: 0 0 28px;
  max-width: 460px;
  line-height: 1.7;
}
.na-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.55);
}
.na-btn:hover {
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.7);
}
.na-btn:active { transform: translateY(0); }
.na-hero-illustration {
  position: relative;
  width: 100%;
  height: 280px;
}
.na-hero-illustration svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* 顶部 Hero 区与 Tab 之间的细分割带 */
.na-hero-divider {
  height: 6px;
  background: #f1f5fb;
  border-top: 1px solid #e6edf7;
  border-bottom: 1px solid #e6edf7;
}

/* ========== Tab 导航 ========== */
.na-tabs {
  background: #ffffff;
  border-bottom: 1px solid #eef1f6;
  position: sticky;
  top: 0;
  z-index: 10;
}
.na-tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.na-tab {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: color .2s ease;
}
.na-tab:hover { color: #1d4ed8; text-decoration: none; }
.na-tab.active {
  color: #0f172a;
  font-weight: 700;
}
.na-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #2563eb;
}

/* ========== 内容区（活动卡片网格 + 浅蓝渐变背景，随内容高度自适应） ========== */
.na-content {
  position: relative;
  overflow: hidden;
  /* 背景用 CSS 渐变，随卡片数量自动铺满整个容器，天然响应式 */
  background:
    radial-gradient(1200px 400px at 50% 0%, rgba(219, 234, 254, 0.7) 0%, rgba(219, 234, 254, 0) 70%),
    linear-gradient(180deg, #eaf2ff 0%, #f6faff 100%);
}
.na-content-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

/* ========== 活动卡片（.activity-* 原样，与插件 view 一致） ========== */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.activity-card {
  display: block;
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.16,1,.3,1),
              box-shadow .3s cubic-bezier(.16,1,.3,1),
              border-color .3s ease;
}
.activity-card:hover { color: inherit; text-decoration: none; }
.activity-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 14px 34px -12px rgba(37, 99, 235, 0.3);
  transform: translateY(-4px);
}

/* 卡片视觉头（顶部图片位，可留空 → 显示占位图标） */
.activity-visual {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef2f7, #e2e8f0);
}
/* 图片：留空(src为空)时由 JS 加 .no-img 隐藏；填图后铺满 */
.activity-visual .activity-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.activity-visual.no-img .activity-img { display: none; }
.activity-visual .activity-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}
.activity-visual .icon-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  box-shadow: 0 8px 20px -8px rgba(30, 64, 175, 0.35);
}
.activity-visual svg {
  width: 30px;
  height: 30px;
  display: block;
}

/* 状态标签 */
.activity-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #ffffff;
  z-index: 2;
}
.activity-tag.ongoing  { background: #2563eb; }
.activity-tag.upcoming { background: #6366f1; }
.activity-tag.ended    { background: #94a3b8; }

/* 卡片正文 */
.activity-body {
  padding: 16px 18px 20px;
}
.activity-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  transition: color .22s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.activity-card:hover .activity-title { color: #2563eb; }
.activity-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.activity-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}
.activity-date {
  font-size: 12px;
  color: #94a3b8;
}
.activity-arrow {
  font-size: 14px;
  color: #cbd5e1;
  transform: translateX(-4px);
  opacity: 0;
  transition: all .26s cubic-bezier(.16,1,.3,1);
}
.activity-card:hover .activity-arrow {
  opacity: 1;
  transform: translateX(0);
  color: #2563eb;
}

/* 限时活动倒计时 */
.activity-countdown {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(37,99,235,0.02));
  border-left: 3px solid #2563eb;
}
.activity-countdown .cd-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.activity-countdown .cd-time {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  color: #1e40af;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.activity-countdown.is-ended .cd-label { color: #94a3b8; }
.activity-countdown.is-ended .cd-time { color: #94a3b8; }
.activity-countdown.is-ended { border-left-color: #cbd5e1; background: rgba(148,163,184,0.08); }

/* 空态提示（某 Tab 无卡片时显示） */
.na-empty-hint {
  display: none;
  text-align: center;
  padding: 120px 0 140px;
}
.na-empty-hint p {
  color: #64748b;
  font-size: 15px;
  letter-spacing: 1px;
  margin: 0;
}

/* ========== 页面入场动画 ========== */
@keyframes naFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.na-anim-1 { animation: naFadeUp .7s ease both; animation-delay: .05s; }
.na-anim-2 { animation: naFadeUp .7s ease both; animation-delay: .18s; }
.na-anim-3 { animation: naFadeUp .7s ease both; animation-delay: .30s; }
.na-anim-illu { animation: naFadeUp 1s ease both; animation-delay: .25s; }
.na-anim-tabs { animation: naFadeUp .6s ease both; animation-delay: .45s; }

/* 卡片错峰浮现 */
.activity-grid .activity-card {
  opacity: 0;
  animation: naCardRise .5s cubic-bezier(.16,1,.3,1) forwards;
}
.activity-grid .activity-card:nth-child(1) { animation-delay: .05s; }
.activity-grid .activity-card:nth-child(2) { animation-delay: .12s; }
.activity-grid .activity-card:nth-child(3) { animation-delay: .19s; }
.activity-grid .activity-card:nth-child(4) { animation-delay: .26s; }
.activity-grid .activity-card:nth-child(5) { animation-delay: .33s; }
.activity-grid .activity-card:nth-child(6) { animation-delay: .40s; }
.activity-grid .activity-card:nth-child(7) { animation-delay: .47s; }
.activity-grid .activity-card:nth-child(8) { animation-delay: .54s; }
@keyframes naCardRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .activity-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .na-hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 24px 48px;
    gap: 24px;
  }
  .na-hero-text h1 { font-size: 36px; }
  .na-hero-illustration { height: 220px; }
  .na-tabs-inner {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
  }
  .na-tab { height: 56px; }
  .na-content-inner { padding: 40px 24px 72px; }
}
@media (max-width: 640px) {
  .activity-grid { grid-template-columns: 1fr; }
}

/* 可访问性：减少动效 */
@media (prefers-reduced-motion: reduce) {
  .na-hero, .na-tabs, .na-content,
  .activity-grid .activity-card {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
