/* 外层轮播框 */
.home-slider{
    position: relative;
    width: min(100%, 1200px);
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    margin-bottom: 50px;
}

/* 横向滚动容器 */
.home-imgbar{
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    overscroll-behavior-x: contain;

    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* IE/Edge old */
}

.home-imgbar::-webkit-scrollbar{
    display: none;                 /* Chrome/Safari */
}

/* 每张卡片占满一屏 */
.home-img-card{
    flex: 0 0 100%;
    width: 100%;
    height: clamp(260px, 52vw, 680px);
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    isolation: isolate;
    background: #f3f3f3;
}

/* 模糊背景层：由 JS 给 --bg-url 赋值 */
.home-img-card::before{
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--bg-url);
    background-size: cover;
    background-position: center;
    transform: scale(1.12);
    filter: blur(26px) brightness(0.82);
    z-index: 0;
}

/* 再叠一层轻微遮罩，避免背景太乱 */
.home-img-card::after{
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to right,
        rgba(255,255,255,0.14) 0%,
        rgba(255,255,255,0.04) 16%,
        rgba(255,255,255,0) 30%,
        rgba(255,255,255,0) 70%,
        rgba(255,255,255,0.04) 84%,
        rgba(255,255,255,0.14) 100%);
    z-index: 1;
    pointer-events: none;
}

/* 前景主图：等比缩放，不变形 */
.home-img{
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    user-select: none;
    -webkit-user-drag: none;
}

/* 左右切换按钮 */
.home-slider-btn{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    width: 20px;
    height: 40px;
    border: none;
    border-radius: 999px;

    background: rgba(255,255,255,0.5);
    color: #222222be;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 24px rgba(103, 103, 103, 0.12);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.home-slider-btn:hover{
    background: #ffffff;
    color: #222222be;
}

.home-slider-btn:active{
    transform: translateY(-50%) scale(0.96);
}

.home-slider-btn:focus{
    background: rgba(255,255,255,0.5);
    color: #222222be;
}

.home-slider-btn:focus:hover{
    background: #ffffff;
    color: #222222be;
}

.home-slider-btn--prev{
    left: 10px;
}

.home-slider-btn--next{
    right: 10px;
}

/* 手机端隐藏按钮，保留触滑 */
@media (max-width: 768px){
    .home-slider-btn{
        display: none;
    }

    .home-img-card{
        height: clamp(220px, 62vw, 460px);
    }
}

/* 矩形卡片 */
.research-slider-wrap {
  --card-w: 340px;
  --btn-w: 36px;
  --gap: 24px;

  width: 100%;
  padding: 10px 0 20px 0;
  box-sizing: border-box;
}

/* 三栏布局：左按钮 + 中间滚动区 + 右按钮 */
.research-slider-shell {
  display: grid;
  grid-template-columns: var(--btn-w) minmax(0, 1fr) var(--btn-w);
  column-gap: 12px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* 中间横向滚动区 */
.research-slider {
  list-style: none;
  margin: 0 !important;
  padding-top: 10px;
  padding-bottom: 18px;

  /* 保证第一个和最后一个 li 也能进入正中 */
  padding-inline-start: calc((100% - var(--card-w)) / 2) !important;
  padding-inline-end: calc((100% - var(--card-w)) / 2) !important;

  display: flex;
  justify-content: flex-start;
  gap: var(--gap);

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: calc((100% - var(--card-w)) / 2);

  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;

  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* 隐藏滚动条 */
.research-slider::-webkit-scrollbar {
  display: none;
}

/* 每个 li 卡片 */
.research-slider > li {
  flex: 0 0 var(--card-w);
  min-height: 220px;
  padding: 24px 22px;

  background: #ffffff;
  border: 1px solid #e6e6e6;
  border-radius: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  box-sizing: border-box;
  line-height: 1.8;
  scroll-snap-align: center;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;

  cursor: default;
  user-select: none;
}

.research-card-title {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #222222;
}

.research-card-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #444444;
}

/* 卡片内部统一默认箭头 */
.research-slider > li,
.research-slider > li * {
  cursor: default !important;
}

/* 当前居中的卡片 */
.research-slider > li.is-active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  border-color: #cfcfcf;
}

/* 左右按钮 */
.research-slider-btn {
  position: relative;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.5);
  color: #222222be;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 24px rgba(103, 103, 103, 0.12);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;

  box-sizing: border-box;
}

.research-slider-btn:hover {
  background: #ffffff;
  color: #222222be;
}

.research-slider-btn:active {
  transform: scale(0.96);
}

.research-slider-btn:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.5);
  color: #222222be;
}

.research-slider-btn:focus:hover {
  background: #ffffff;
  color: #222222be;
}

.research-slider-btn.is-disabled {
  opacity: 0.35;
}

/* 下方 dots */
.research-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  box-sizing: border-box;
}

.research-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d7d7d7;
  transition:
    background-color 0.25s ease,
    transform 0.25s ease;
}

.research-dot.is-active {
  background: #666666;
  transform: scale(1.15);
}

/* 手机端：改成纵向列表，隐藏按钮和 dots */
@media (max-width: 768px) {
  .research-slider-shell {
    display: block;
  }

  .research-slider {
    display: flex;
    flex-direction: column;
    gap: 14px;

    width: 100%;
    overflow: visible;

    padding-top: 0;
    padding-bottom: 0;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;

    scroll-snap-type: none;
    scroll-behavior: auto;
    scroll-padding-inline: 0;
  }

  .research-slider > li {
    flex: none;
    width: 100%;
    min-height: auto;
    padding: 18px 16px;
    border-radius: 18px;
    scroll-snap-align: none;
    transform: none !important;
  }

  .research-slider > li.is-active {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #e6e6e6;
  }

  .research-slider-btn,
  .research-dots {
    display: none !important;
  }

  .research-card-title {
    font-size: 1.08rem;
    margin-bottom: 10px;
  }

  .research-card-text {
    font-size: 0.98rem;
    line-height: 1.7;
  }
}

.hyphen-text {
  hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;

    overflow-wrap: normal;
    word-break: normal;
    white-space: normal;
}
