/* ============================================================
   cover.css · 封面图系统
   项目：offroadupgrades.com
   封面图类别：C3（户外/生活）
   结构：十一层（背景/纹理/自然/树木/建筑/光影/鲜花/流水/行业/主体/光点）
   比例：全站统一 16:9（1200×675 基准）
   ============================================================ */

/* ---------- 封面容器 ---------- */
.cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--cover-bg, hsl(145, 45%, 88%));
}

/* ---------- 封面 SVG 层 ---------- */
.cover-wrapper .cover-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- HSL 变量（默认 C3 户外） ---------- */
:root {
  --cover-bg-h: 145;
  --cover-bg-s: 45%;
  --cover-bg-l: 88%;

  --cover-accent-h: 25;
  --cover-accent-s: 70%;
  --cover-accent-l: 55%;

  --cover-bg: hsl(var(--cover-bg-h), var(--cover-bg-s), var(--cover-bg-l));
  --cover-accent: hsl(var(--cover-accent-h), var(--cover-accent-s), var(--cover-accent-l));
}

/* ---------- 十一层结构 ---------- */
.cover-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cover-layer-1-bg       { z-index: 1; }
.cover-layer-2-texture  { z-index: 2; opacity: 0.08; }
.cover-layer-3-nature   { z-index: 3; opacity: 0.30; }
.cover-layer-4-trees    { z-index: 4; opacity: 0.40; }
.cover-layer-5-building { z-index: 5; opacity: 0.35; }
.cover-layer-6-light    { z-index: 6; opacity: 0.15; }
.cover-layer-7-flower   { z-index: 7; opacity: 0.40; }
.cover-layer-8-water    { z-index: 8; opacity: 0.35; }
.cover-layer-9-industry { z-index: 9; opacity: 0.50; }
.cover-layer-10-subject  { z-index: 10; }
.cover-layer-11-lights   { z-index: 11; }

/* ---------- 第十层：产品主体 + 柔光边缘 ---------- */
.cover-subject {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 45%;
  height: auto;
  filter: drop-shadow(0 0 30px var(--cover-accent));
}

/* ---------- 第十一层：闪烁光点 ---------- */
.cover-lights {
  position: absolute;
  inset: 0;
}
.cover-lights .light-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cover-accent);
  box-shadow: 0 0 8px var(--cover-accent);
  animation: light-pulse var(--duration-slower) var(--ease-in-out) infinite;
  animation-duration: 3s;
}
.cover-lights .light-dot:nth-child(1) { top: 20%; left: 15%; animation-duration: 2.4s; animation-delay: 0s; }
.cover-lights .light-dot:nth-child(2) { top: 30%; left: 80%; animation-duration: 3.6s; animation-delay: 0.5s; }
.cover-lights .light-dot:nth-child(3) { top: 70%; left: 25%; animation-duration: 2.8s; animation-delay: 1.0s; }
.cover-lights .light-dot:nth-child(4) { top: 65%; left: 72%; animation-duration: 3.2s; animation-delay: 1.5s; }
.cover-lights .light-dot:nth-child(5) { top: 45%; left: 50%; animation-duration: 2.6s; animation-delay: 2.0s; }
.cover-lights .light-dot:nth-child(6) { top: 15%; left: 55%; animation-duration: 3.4s; animation-delay: 2.5s; }

/* ---------- 封面标题（降级后显示） ---------- */
.cover-fallback-title {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  text-align: center;
  z-index: 12;
}

/* ---------- 三级降级机制 ---------- */
.cover-wrapper.is-fallback-svg {
  /* SVG 加载失败，纯色底 */
  background: var(--cover-bg);
}
.cover-wrapper.is-fallback-svg .cover-fallback-title { display: flex; }

.cover-wrapper.is-fallback-title {
  /* 所有图形都失败，只显示标题 */
  background: var(--cover-bg);
}
.cover-wrapper.is-fallback-title .cover-svg { display: none; }
.cover-wrapper.is-fallback-title .cover-fallback-title { display: flex; }

/* ---------- 移动端优化 ---------- */
@media (max-width: 768px) {
  .cover-wrapper { border-radius: var(--radius-sm); }
  .cover-lights .light-dot:nth-child(5),
  .cover-lights .light-dot:nth-child(6) { display: none; }
  .cover-lights .light-dot {
    width: 5px;
    height: 5px;
    animation-duration: 2s;
  }
  .cover-fallback-title { font-size: var(--text-lg); }
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .cover-lights .light-dot {
    animation: none;
    opacity: 0.6;
  }
}
