/* ============================================================
   News KV / Hero（news.html Section 1）
   Figma kv（1920x850，白→#ECF6FB 渐变底）
   左主图 910x515 + 右蓝色新闻面板 755x475 + 小装饰
   等比缩放：min(vw, px) + 百分比定位
   ============================================================ */

.nw-kv {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 850;
  background: linear-gradient(-49deg, #FFFFFF 0%, #ECF6FB 100%);
  overflow: hidden;
}

/* 左：主图轮播容器（Figma x=146, y=119, 910x515, 圆角 8）
   3 张图片叠加，切换时新图自左侧划入（--translate-xl 幅度），指示点内嵌左下角 */
.nw-kv__img-wrap {
  position: absolute;
  left: 7.6%;                        /* 146/1920 */
  top: 20%;                          /* 图片垂直居中：(850-510)/2=170 → 170/850 */
  width: 47.4%;                      /* 910/1920 */
  aspect-ratio: 910 / 510;           /* Figma #591:20219 910×510 */
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nw-kv__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateX(calc(-1 * var(--translate-xl)));   /* 左侧划入起点 */
  transition: opacity var(--duration-slow) var(--ease-standard),
              transform var(--duration-slow) var(--ease-decelerate);
}

.nw-kv__img.is-active {
  opacity: 1;
  transform: translateX(0);
}

/* 轮播控制点（图片下方，原 news-kv-deco.svg 装饰位置：3 个绿色六边形 22x20） */
.nw-kv__deco {
  position: absolute;
  left: 28.8%;                       /* 553/1920 */
  top: 83.4%;                        /* 709/850 */
  display: flex;
  gap: 15px;                         /* 3×22 + 2×15 = 96，与原装饰等宽 */
}

.nw-kv__dot {
  position: relative;
  width: 22px;
  height: 20px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

/* 触控目标扩展 */
.nw-kv__dot::before {
  content: "";
  position: absolute;
  inset: -15px;
}

.nw-kv__dot svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nw-kv__dot svg path {
  fill: var(--color-secondary);
  opacity: 0.3;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.nw-kv__dot:hover svg path {
  opacity: 0.6;
}

.nw-kv__dot.is-active svg path {
  opacity: 1;
}

/* 右：蓝色新闻面板（Figma x=1024, y=256, 755x475, 圆角 8；
   右上角 45° 斜切：Figma #596:35275 路径 (692,0)→(755,63)，用设计稿 SVG 路径作背景。
   注意：不能设 background-color——SVG 斜切/圆角外是透明区域，
   若有同色底色会把斜切"填平"，必须透出 kv 的渐变背景 */
.nw-kv__panel {
  position: absolute;
  left: 53.33%;                      /* 1024/1920 */
  top: 30.12%;                       /* 256/850 */
  width: 39.32%;                     /* 755/1920 */
  aspect-ratio: 755 / 475;
  background-image: url(../images/nw-kv-panel.svg);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* 面板内 3 组文字叠加切换（新组自右侧划入，--translate-xl 幅度） */
.nw-kv__texts {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(var(--translate-xl));               /* 右侧划入起点 */
  transition: opacity var(--duration-slow) var(--ease-standard),
              transform var(--duration-slow) var(--ease-decelerate);
  pointer-events: none;
}

.nw-kv__texts.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nw-kv__date {
  position: absolute;
  left: 5.17%;                       /* 39/755 */
  top: 8%;                           /* 38/475 */
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: min(1.25vw, 24px);      /* 24/1920 */
  color: var(--color-white);
}

.nw-kv__title {
  position: absolute;
  left: 5.17%;
  top: 21.26%;                       /* 101/475 */
  width: 88.34%;                     /* 667/755 */
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 800;
  font-size: min(1.667vw, 32px);     /* 32/1920 — 新闻面板紧凑标题，非全屏 hero */
  line-height: min(2.5vw, 48px);     /* 48/1920 */
  letter-spacing: -0.02em;
  color: var(--color-white);
}

.nw-kv__line {
  position: absolute;
  left: 5.43%;                       /* 41/755 */
  top: 46.53%;                       /* 221/475 */
  width: 88.08%;                     /* 665/755 */
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.nw-kv__desc {
  position: absolute;
  left: 5.17%;
  top: 53.68%;                       /* 255/475 */
  width: 88.34%;
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: min(1.042vw, 20px);     /* 20/1920 */
  line-height: min(1.771vw, 34px);   /* 34/1920 */
  letter-spacing: -0.02em;
  text-align: justify;
  color: var(--color-white);
}

/* 按钮：白描边胶囊（Figma 591:20227 贝塞尔胶囊路径，180x58）
   顶部对齐面板 79% 处（设计稿 82.32% 基础上微向上移） */
.nw-kv__btn {
  position: absolute;
  left: 69.4%;                       /* 524/755 */
  top: 79%;
  width: min(9.479vw, 182px);        /* 182/1920 */
  aspect-ratio: 182 / 58;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform var(--duration-micro, 150ms) var(--ease-standard, ease);
}

.nw-kv__btn-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* fill 必须作用在 path 上（path 自带内联 stroke，svg 上设置会被覆盖） */
.nw-kv__btn-shape path {
  transition: fill var(--duration-base) var(--ease-standard);
}

.nw-kv__btn span {
  position: relative;
  font-family: var(--font-primary);
  font-size: min(0.9375vw, 18px);
  font-weight: 400;
  color: var(--color-white);
  white-space: nowrap;
  transition: color var(--duration-base) var(--ease-standard);
}

.nw-kv__btn:hover .nw-kv__btn-shape path {
  fill: var(--color-white);         /* hover：白色背景（白色描边保留） */
}

.nw-kv__btn:hover span {
  color: var(--color-primary);      /* hover：文字变蓝 */
}

.nw-kv__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==================== 响应式（1200 以下移动端布局） ==================== */
@media (max-width: 1200px) {
  .nw-kv {
    aspect-ratio: auto;
    padding: 80px var(--container-padding) 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;             /* 图片与蓝色面板间距 10px */
  }

  .nw-kv__img-wrap {
    position: relative;   /* 保持定位上下文：内部 3 张叠加图片以 wrap 为包含块 */
    left: auto;           /* 重置 PC absolute 定位残留，避免 relative 偏移 */
    top: auto;
    width: 100%;
    max-width: 800px;
  }

  /* 文字组改为单组流式显示，切换时自右侧划入（复用全局 slide-right keyframes，
     本地覆盖 --translate-md 为 --translate-xl 以放大划入幅度） */
  .nw-kv__texts {
    position: static;
    display: none;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: auto;
    --translate-md: var(--translate-xl);
  }

  .nw-kv__texts.is-active {
    display: flex;
    animation: slide-right var(--duration-slow) var(--ease-decelerate);
  }

  /* 面板改为流式布局，字体用固定 px（vw 在窄屏会过小） */
  .nw-kv__panel {
    position: relative;
    left: auto;           /* 重置 PC absolute 定位残留（left 53.33% 会把面板推出屏幕） */
    top: auto;
    width: 100%;
    max-width: 800px;
    aspect-ratio: auto;
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* 移动端不用斜切角 SVG 背景，改平板蓝色圆角色块（高度随内容自适应，按钮不再被裁） */
    background-image: none;
    background-color: var(--color-primary);
    border-radius: 8px;
  }

  .nw-kv__date {
    position: static;
    font-size: 20px;
  }

  .nw-kv__title {
    position: static;
    width: 100%;
    font-size: 28px;
    line-height: 40px;
  }

  .nw-kv__line {
    position: static;
    width: 100%;
  }

  .nw-kv__desc {
    position: static;
    width: 100%;
    font-size: 18px;
    line-height: 28px;
    text-align: left;
  }

  .nw-kv__btn {
    position: relative;   /* 不能用 static：内部形状 SVG 是 absolute inset:0，需要按钮作定位上下文 */
    left: auto;
    top: auto;
    align-self: center;   /* 按钮在蓝色面板内左右居中 */
    width: min(40vw, 182px);
  }

  /* 文字字号跟随视口 vw 在窄屏会过小，改固定 px 保持与按钮比例 */
  .nw-kv__btn span {
    font-size: 16px;
  }

  .nw-kv__deco {
    display: none;
  }
}

@media (max-width: 768px) {
  .nw-kv {
    padding: 90px var(--container-padding) 40px;   /* 图片->面板间距沿用上方 10px */
  }

  .nw-kv__panel {
    padding: 32px 24px;
    gap: 16px;
  }

  .nw-kv__texts {
    gap: 16px;
  }

  .nw-kv__date {
    font-size: 18px;
  }

  .nw-kv__title {
    font-size: 32px;
    line-height: 42px;
  }

  .nw-kv__desc {
    font-size: 16px;
    line-height: 26px;
  }
}

/* ==================== 无障碍降级 ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
