/* 首页活动 banner（依据 testdata/banner 原型改造，数据来自 events 自定义类型） */

.banner {
  --paper: #e4ede0;
  --green: #67b83a;
  --green-deep: #529f2d;
  --green-soft: #7eaf67;
  --ink-green: #5eaa3e;
  /* 顶部导航为 fixed，预留高度由 js/banner.js 按实际头部高度写入 */
  --header-offset: 1.7rem;
  --reserved-top: var(--header-offset);
  /* 右侧活动图片视图较上一版扩大 10% */
  --slide-width: 39.05vw;
  /* 0.676 为设计图中卡片的宽高比 */
  --slide-height: calc(var(--slide-width) * 0.676);

  position: relative;
  width: 100%;
  /* PC 端按 1920×1080 设计稿随宽度等比缩放，不再依赖视口高度 */
  height: auto;
  min-height: 0;
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--paper);
  outline: none;
  color: var(--ink-green);
  font-family: "muli", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;

  background: url("../images/home-banner.jpg?v=20260824") no-repeat center center / cover;
  /* background-attachment: fixed; */
}

.banner *,
.banner *::before,
.banner *::after {
  box-sizing: border-box;
}

.banner button {
  color: inherit;
  font: inherit;
}

.banner .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


.banner__inner {
  position: relative;
  z-index: 2;
  display: grid;
  /* 活动文案高度变化时不得反向撑高 banner，否则时间轮会随 SVG 尺寸一起放大 */
  grid-template-rows: minmax(0, 1fr);
  /* 左侧时间选择器整体宽度缩至上一版的 90% */
  grid-template-columns: minmax(351px, 27.9vw) minmax(0, 1fr);
  min-height: 0;
  gap: clamp(14px, 1.4vw, 28px);
  width: 100%;
  height: 100%;
  padding: var(--reserved-top) clamp(28px, 2.9vw, 58px) clamp(22px, 2.5vw, 48px);
}

/* 没有任何活动时只保留活动面板，不展示年份、月份和弧线筛选器 */
.banner.is-eventless .banner__inner {
  grid-template-columns: minmax(0, 1fr);
}

.banner.is-eventless .time-nav {
  display: none;
}

.banner.is-eventless .activity-panel {
  width: min(100%, 1180px);
}

.banner.is-eventless #activity-title {
  max-width: 100%;
}

.banner.is-eventless .activity-carousel-shell,
.banner.is-eventless .carousel-actions {
  display: none;
}

.banner.is-eventless .activity-caption {
  min-height: 0;
  margin-top: clamp(18px, 1.56vw, 30px);
}

.time-nav {
  position: relative;
  min-width: 0;
  height: 100%;
}

.time-arc {
  position: absolute;
  z-index: -1;
  /* 弧线高度由 108% 缩至 97.2%，保持垂直居中 */
  top: 1.4%;
  left: -4%;
  /* 宽度由高度按 viewBox 比例推导（width: auto），保证圆弧只随高度等比缩放、不被拉伸 */
  width: auto;
  height: 97.2%;
  overflow: visible;
  pointer-events: none;
}

.orbit-axis {
  --axis-marker-size: 32px;
  --axis-marker-offset: 16px;
  position: absolute;
  z-index: 0;
  /* 高度对齐弧心（js/banner.js 写入），使末端标记与选中月份圆点重合 */
  top: var(--arc-center-y, 50%);
  /* 起点由 js/banner.js 写入像素值，避免与轮盘几何计算使用不同比例 */
  left: var(--axis-start-x, 44.5%);
  /* 长度由 js/banner.js 按弧线几何写入，使末端标记与月份圆点同圈；未执行 JS 时退回按比例 */
  right: auto;
  width: var(--axis-length, 43.8%);
  height: 1px;
  background: rgba(94, 157, 62, 0.35);
  pointer-events: none;
}

/* 指示线末端的圆圈标记（对应设计图轴线右端的小圆圈 + 圆点） */
.orbit-axis span {
  position: absolute;
  top: 0;
  left: calc(100% + var(--axis-marker-offset));
  right: auto;
  width: var(--axis-marker-size);
  height: var(--axis-marker-size);
  border: 1px solid rgba(94, 157, 62, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* .orbit-axis span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  transform: translate(-50%, -50%);
} */

/* 弧线轮盘：容器覆盖整个日期轮区域，元素按极坐标绝对定位（位置由 js/banner.js 计算） */
.banner .wheel {
  position: absolute;
  inset: 0;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
}
.banner .wheel:active {
  cursor: grabbing;
}

.banner .wheel > .year-pick,
.banner .wheel > .month-pick {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.year-carousel {
  /* 位于月份容器之上：年份标签可直接点击/拖动，其余区域由月份轮盘接管拖动 */
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.month-carousel {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.banner .year-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7.2px 10.8px 7.2px 0;
  border: 0;
  background: transparent;
  color: rgba(100, 180, 56, 0.52);
  /* 在上一版未选中字号基础上整体缩至 90%，并与选中项保持 600 字重 */
  font-size: clamp(23.76px, 1.7496vw, 34.56px);
  font-weight: 600;
  letter-spacing: 0.0135em;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  /* 注意：transform 由 js/banner.js 逐帧写入，不能加过渡，否则动画会滞后 */
  transition:
    color 0.45s ease,
    opacity 0.45s ease,
    font-size 0.45s ease;
}

.year-pick::after {
  content: "";
  width: 0;
  height: 1.8px;
  margin-left: 0;
  background: currentColor;
  opacity: 0.65;
  transition:
    width 0.45s ease,
    margin-left 0.45s ease;
}

.year-pick.is-selected {
  color: var(--green);
  font-size: clamp(36px, 2.61vw, 50.4px);
  font-weight: 600;
}

.year-pick.is-selected::after {
  width: 27px;
  margin-left: 9.9px;
}

.year-pick:hover,
.year-pick:focus-visible {
  color: var(--green-deep);
}

.year-pick:focus-visible,
.month-pick:focus-visible,
.round-button:focus-visible,
.more-link:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 4px;
}

.month-pick {
  position: relative;
  display: grid;
  width: 43.2px;
  height: 43.2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  background: transparent;
  cursor: pointer;
  /* transform 由 js/banner.js 逐帧写入，不能加过渡 */
}

.month-dot {
  display: block;
  width: 5.4px;
  height: 5.4px;
  border-radius: 50%;
  background: rgba(92, 167, 52, 0.95);
  transition:
    width 0.35s ease,
    height 0.35s ease,
    background-color 0.35s ease,
    box-shadow 0.35s ease;
}

.month-pick__label {
  position: absolute;
  top: 50%;
  right: calc(100% + 6.3px);
  padding: 3.6px 7.2px;
  border-radius: 999px;
  background: rgba(92, 155, 57, 0.9);
  color: #fff;
  font-size: 9.9px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  /* 反向抵消元素在弧上的倾斜，保证提示文字水平 */
  transform: rotate(calc(-1 * var(--arc-rotate, 0deg))) translate(4px, -50%);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.month-pick:hover .month-pick__label,
.month-pick:focus-visible .month-pick__label {
  opacity: 1;
  transform: rotate(calc(-1 * var(--arc-rotate, 0deg))) translate(0, -50%);
}

.month-pick.is-active .month-dot {
  width: 12.6px;
  height: 12.6px;
  background: var(--green);
  box-shadow: 0 0 0 4.5px rgba(228, 237, 224, 0.82);
}

.month-caption {
  display: none;
}

.month-caption__line {
  width: 25px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.activity-panel {
  position: relative;
  min-width: 0;
  height: 100%;
  /* padding-top: clamp(6px, .6vw, 20px); */
}

.activity-heading {
  position: relative;
  z-index: 4;
}

.activity-meta {
  margin: 0;
  color: var(--ink-green);
  font-size: clamp(23px, 1.75vw, 32px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.2;
}

.activity-heading__row {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 58px);
  width: calc(100% - clamp(46px, 5.8vw, 112px));
  max-width: 100%;
  /* margin-top: clamp(2px, 0.2vw, 10px); */
}

#activity-title {
  max-width: min(870px, 68vw);
  margin: 0;
  color: var(--green);
  font-size: clamp(28px, 2.2vw, 48px);
  /* font-weight: 300; */
  letter-spacing: 0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

.activity-caption__title {
  max-width: min(870px, 100%);
  margin: clamp(2px, 0.25vw, 4px) 0 0;
  color: var(--green);
  font-size: clamp(28px, 2.2vw, 48px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.25;
  text-wrap: balance;
}

.more-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--ink-green);
  font-size: clamp(14px, 0.92vw, 17px);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s ease;
}

.more-link:hover {
  color: var(--green-deep);
  text-decoration: none;
}

.play-icon {
  position: relative;
  display: inline-grid;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  place-items: center;
  background: linear-gradient(145deg, #81c955, #58a62f);
  box-shadow: 0 5px 15px rgba(83, 149, 44, 0.16);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.play-icon::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #fff;
}

.more-link:hover .play-icon {
  transform: scale(1.08);
}

.activity-carousel-shell {
  position: relative;
  z-index: 2;
  /* 1.48 倍卡片宽度：容纳当前卡片及右侧两张叠放卡片（含少量余量） */
  width: calc(var(--slide-width) * 1.48);
  max-width: 100%;
  height: var(--slide-height);
  margin-top: clamp(12px, 1.2vw, 30px);
  overflow: hidden;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.activity-carousel-shell.is-changing {
  opacity: 0.02;
  transform: translateY(8px);
}

.activity-carousel-shell.is-empty {
  visibility: hidden;
}

.activity-swiper {
  width: var(--slide-width);
  height: var(--slide-height);
  margin: 0;
  overflow: visible;
}

.activity-swiper .swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: clamp(6px, 0.5vw, 10px) solid var(--green);
  background: #dce8d7;
  cursor: grab;
}

.activity-swiper .swiper-slide:active {
  cursor: grabbing;
}

.activity-swiper .swiper-slide::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  background: rgba(228, 237, 224, 0.57);
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.65s ease;
}

.activity-swiper .swiper-slide-active::after {
  opacity: 0;
}

.activity-swiper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.activity-slide-link {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.activity-slide-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -8px;
}

.activity-caption {
  position: relative;
  z-index: 4;
  width: min(100%, 920px);
  min-height: 5.16vw;
  margin-top: clamp(15px, 1.46vw, 28px);
  color: #78b25d;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.activity-caption.is-changing {
  opacity: 0;
  transform: translateY(5px);
}

.activity-caption.is-empty .activity-date {
  display: none;
}

.activity-description {
  max-width: 650px;
  margin: 0;
  font-size: clamp(16px, 1.05vw, 20px);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.5;
}

.activity-caption__title:not(:empty) + .activity-description {
  margin-top: clamp(8px, 0.6vw, 12px);
}

.activity-date {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: .2vw 0 0;
  color: #72ad57;
  font-size: clamp(15px, 0.96vw, 17px);
  letter-spacing: 0.035em;
}

.activity-date svg {
  width: 18px;
  height: 18px;
}

.carousel-actions {
  position: absolute;
  z-index: 6;
  right: clamp(46px, 5.8vw, 112px);
  bottom: clamp(30px, 5.2vw, 100px);
  display: flex;
  gap: clamp(10px, 1vw, 17px);
}

.round-button {
  display: grid;
  width: clamp(42px, 2.5vw, 48px);
  height: clamp(42px, 2.5vw, 48px);
  padding: 0;
  border: 1px solid rgba(84, 159, 45, 0.8);
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.round-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.round-button:not(:disabled):hover {
  border-color: var(--green);
  background: #fff;
  color: var(--green-deep);
  transform: translateY(-2px);
}

.round-button:not(:disabled):active {
  transform: translateY(0) scale(0.96);
}

.round-button:disabled {
  border-color: rgba(84, 159, 45, 0.24);
  background: rgba(230, 238, 226, 0.45);
  color: rgba(94, 157, 62, 0.35);
  cursor: default;
  transform: none;
}

.toast {
  position: absolute;
  z-index: 20;
  bottom: clamp(100px, 10.2vw, 112px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 40px);
  padding: 12px 19px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(48, 70, 39, 0.91);
  box-shadow: 0 14px 35px rgba(51, 79, 39, 0.18);
  color: #f6fbf3;
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 0.28s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ce46b;
  box-shadow: 0 0 0 4px rgba(156, 228, 107, 0.12);
}

@keyframes heading-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes media-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.activity-heading {
  animation: heading-in 0.8s 0.08s both cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-carousel-shell {
  animation: media-in 0.9s 0.16s both cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-caption,
.carousel-actions {
  animation: heading-in 0.75s 0.26s both cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 1280px) {
  .banner {
    --slide-width: 42.9vw;
    min-height: clamp(680px, 57.8vw, 740px);
  }

  .banner__inner {
    grid-template-columns: minmax(315px, 27.9vw) minmax(0, 1fr);
  }

  .activity-heading {
    padding-top: 0;
  }

  .activity-heading__row {
    gap: 20px;
  }

  #activity-title {
    max-width: 72vw;
  }
}

/* 911–1100px：保留桌面双栏，同时收紧日期栏和标题，避免临界宽度逐词换行 */
@media (min-width: 911px) and (max-width: 1100px) {
  .banner {
    --slide-width: 52.8vw;
    min-height: clamp(700px, 66.7vw, 740px);
  }

  .banner__inner {
    grid-template-columns: minmax(252px, 25.2vw) minmax(0, 1fr);
    gap: 14px;
  }

  .activity-heading__row {
    width: 100%;
    gap: 12px;
  }

  #activity-title {
    flex: 1 1 auto;
    max-width: none;
    font-size: clamp(30px, 3.3vw, 38px);
  }

  .more-link {
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .play-icon {
    width: 26px;
    height: 26px;
  }
}

/* 超宽屏安全范围：宽度继续响应，但 banner 不超过当前首屏高度 */
@media (min-width: 1921px) {
  .banner {
    max-height: 100vh;
    max-height: 100svh;
  }
}

/* 移动端：910px 及以下隐藏年月日期轮盘，按手机设计稿改为图片、标题、日期、入口的纵向结构 */
@media (max-width: 910px) {
  .banner {
    /* 窄屏下的兜底值，实际高度仍由 js/banner.js 测量后写入 */
    --header-offset: 90px;
    --mobile-gutter: clamp(20px, 4.7vw, 48px);
    --mobile-peek: clamp(12px, 2.4vw, 24px);
    --slide-width: calc(
      100vw - var(--mobile-gutter) - var(--mobile-gutter) - var(--mobile-peek)
    );

    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    overflow-x: clip;
    overflow-y: visible;
  }

  .banner__inner {
    display: block;
    height: auto;
    padding: calc(var(--header-offset) + clamp(10px, 2vw, 18px)) var(--mobile-gutter)
      clamp(48px, 8vw, 76px);
  }

  .time-nav {
    display: none;
  }

  .activity-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    padding: 0;
  }

  .activity-heading {
    display: contents;
  }

  .activity-meta {
    display: block;
    margin-bottom: clamp(4px, 0.8vw, 8px);
  }

  .activity-heading__row {
    display: contents;
  }

  .activity-carousel-shell {
    order: 1;
    width: calc(100vw - var(--mobile-gutter));
    max-width: none;
    height: var(--slide-height);
    margin-top: 0;
    overflow: hidden;
  }

  .activity-swiper {
    width: var(--slide-width);
    height: var(--slide-height);
  }

  .activity-swiper .swiper-slide {
    border: 0;
  }

  .carousel-actions {
    position: static;
    order: 2;
    align-self: flex-end;
    gap: clamp(8px, 1.8vw, 14px);
    margin-top: clamp(12px, 2.4vw, 20px);
    margin-right: var(--mobile-gutter);
    margin-bottom: clamp(20px, 4vw, 32px);
  }

  .round-button {
    width: clamp(30px, 4.2vw, 38px);
    height: clamp(30px, 4.2vw, 38px);
  }

  .round-button svg {
    width: 18px;
    height: 18px;
  }

  #activity-title {
    order: 3;
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: clamp(24px, 4.5vw, 36px);
    letter-spacing: 0.01em;
    line-height: 1.42;
    text-align: left;
  }

  .activity-caption__title {
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: clamp(24px, 4.5vw, 36px);
    letter-spacing: 0.01em;
    line-height: 1.42;
    text-align: left;
  }

  #activity-title:not(:empty)::after {
    content: "";
    display: block;
    width: clamp(42px, 6.5vw, 58px);
    height: 3px;
    margin-top: clamp(18px, 2.8vw, 26px);
    border-radius: 999px;
    background: var(--green);
  }

  .activity-caption {
    order: 4;
    width: 100%;
    min-height: 0;
    margin-top: clamp(18px, 3vw, 26px);
  }

  .banner:not(.is-eventless) .activity-description {
    display: none;
  }

  .activity-date {
    margin: clamp(8px, 1.4vw, 12px) 0 0;
    color: #82957a;
    font-size: clamp(15px, 2.2vw, 18px);
    letter-spacing: 0.04em;
  }

  .activity-date svg {
    display: none;
  }

  .more-link {
    order: 5;
    align-self: flex-start;
    margin: clamp(24px, 4vw, 34px) 0 0;
    padding: 11px clamp(22px, 3.4vw, 30px);
    border-radius: 999px;
    background: linear-gradient(145deg, #78c94d, #5aa932);
    box-shadow: 0 7px 18px rgba(83, 149, 44, 0.16);
    color: #fff;
    font-size: clamp(14px, 2vw, 17px);
    font-weight: 500;
    line-height: 1;
  }

  .more-link:hover {
    background: linear-gradient(145deg, #6fc244, #4f9e2b);
    color: #fff;
  }

  .more-link .play-icon {
    display: none;
  }

  .banner.is-eventless #activity-title::after {
    display: none;
  }

  .banner.is-eventless .activity-caption {
    margin-top: 16px;
  }

  .toast {
    position: fixed;
    bottom: 24px;
  }
}

/* 首页 banner 为浅色底，顶部导航沿用「已滚动」状态的深色文字与彩色 logo（对应设计稿） */
.header-wrap:not(.in) .header-data {
  background-image: none;
}

.header-wrap:not(.in) .menu {
  color: #2e272e;
  text-shadow: none;
}

.header-wrap:not(.in) .site-logo img:nth-child(1) {
  transform: translateY(0);
  position: initial;
  visibility: visible;
}

.header-wrap:not(.in) .site-logo img:nth-child(2) {
  transform: translateY(-100%);
  position: absolute;
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .banner *,
  .banner *::before,
  .banner *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
