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

.nw-kv {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 850;
  background: linear-gradient(-49deg, var(--color-white) 0%, var(--color-soft-blue) 100%);
  overflow: hidden;
}

/* 左：主图轮播容器（Figma x=146, y=119, 910x515, 圆角 8）
   3 张图片叠加，切换时 fade in/out（无滑动） */
.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;
  /* 入场动画：从浏览器左侧滑入 */
  animation: nw-img-enter 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.2s both;
}

@keyframes nw-img-enter {
  from {
    opacity: 0;
    transform: translateX(-80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nw-kv__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  /* 轮播切换：纯 fade，无滑动 */
  transition: opacity 0.6s ease;
}

.nw-kv__img.is-active {
  opacity: 1;
}

/* 轮播控制点（图片下方，原 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） */
.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;
  /* 入场动画：从浏览器右侧滑入 */
  animation: nw-panel-enter 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.4s both;
}

@keyframes nw-panel-enter {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 面板内 3 组文字叠加切换（轮播时纯 fade，无滑动） */
.nw-kv__texts {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.nw-kv__texts.is-active {
  opacity: 1;
  pointer-events: auto;
}

.nw-kv__date {
  position: absolute;
  left: 5.17%;                       /* 39/755 */
  top: 8%;                           /* 38/475 */
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: min(1.25vw, 1.5rem);      /* 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: 600;
  font-size: min(1.667vw, 2rem);     /* 32/1920 — 新闻面板紧凑标题，非全屏 hero */
  line-height: min(2.5vw, 3rem);     /* 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: 300;
  font-size: min(1.042vw, 1.25rem);     /* 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, 1.125rem);
  font-weight: 300;
  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: 8px;             /* 图片与蓝色面板间距 10px */
  }

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

  .nw-kv__texts {
    position: static;
    display: none;
    flex-direction: column;
    gap: 20px;
    opacity: 1;
    transition: none;
    pointer-events: auto;
  }

  .nw-kv__texts.is-active {
    display: flex;
    animation: nw-mobile-fade 0.6s ease;
  }

  @keyframes nw-mobile-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* 面板改为流式布局，字体用固定 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: var(--radius-md);
  }

  .nw-kv__date {
    position: static;
    font-size: clamp(1rem, 0.16vw + 0.96rem, 1.25rem);
  }

  .nw-kv__title {
    position: static;
    width: 100%;
    font-size: clamp(1.125rem, 0.4vw + 1.03rem, 1.75rem);
    line-height: 1.25;
  }

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

  .nw-kv__desc {
    position: static;
    width: 100%;
    font-size: clamp(1rem, 0.08vw + 0.98rem, 1.125rem);
    line-height: 1.5;
    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: 1rem;
  }

  .nw-kv__deco {
    display: none;
  }
}

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

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

  .nw-kv__texts {
    gap: 16px;
  }

  .nw-kv__date {
    font-size: clamp(1rem, 0.08vw + 0.98rem, 1.125rem);
  }

  .nw-kv__title {
    font-size: clamp(1.25rem, 0.48vw + 1.14rem, 2rem);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nw-kv__desc {
    font-size: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* PC端：导航背景透明，文字保持深色 */
@media (min-width: 993px) {
  .navbar {
    background: rgba(255, 255, 255, 0) !important;
  }

  .navbar.scrolled {
    background: rgba(255, 255, 255, 1) !important;
  }

  .navbar__menu-item > a {
    color: #333333 !important;
  }

  .navbar__brochure {
    color: #333333 !important;
  }

  .navbar__brochure .navbar__icon path {
    fill: #333333 !important;
  }

  .navbar__divider {
    background: var(--color-divider) !important;
  }

  .navbar__lang {
    color: #333333 !important;
  }

  .navbar__lang .navbar__icon path {
    fill: #333333 !important;
  }
}

/* ==================== 无障碍降级 ==================== */
@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;
  }
}
