/* ============================================
   首页样式表 (home.css)
   LAPE实验室网站 - 首页样式
============================================= */
/* 通用标题样式 - 应用于全站的二级标题 */
.h2t {
  color: #527bbd;
  /* 主色调蓝色，用于区分标题 */
}
/* 首页特定标题样式 - 在通用.h2t基础上增加间距 */
.homeTitle {
  margin-top: 20px;
  /* 顶部间距 */
  margin-bottom: 10px;
  /* 底部间距 */
  font-weight: 600;
  /* 加粗字体 */
}
/* 阴影效果通用类 - 应用于需要突出显示的卡片和容器 */
.shadow {
  -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  /* 兼容Webkit浏览器 */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  /* 标准阴影 */
}

.featured {
    margin-bottom: 1.5rem;
}

.w.shadow {
  margin-top: 1.5rem;
}

/* ============================================
   轮播图区域样式 (Carousel)
============================================= */
.carousel-container {
  position: relative;
  width: 100%;
  /* aspect-ratio 的 Safari 兼容方案 */
  height: 0;
  overflow: hidden;
  background-color: #000;
  /* 加载时的背景色 */
  aspect-ratio: 16/9;
  /* Safari 15+ 支持 aspect-ratio */
}
@supports (aspect-ratio: 16/9) {
  .carousel-container {
    height: auto;
    padding-top: 0;
    aspect-ratio: 16/9;
  }
}
.carousel-wrapper {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  -webkit-transition: -webkit-transform 0.5s ease-in-out;
  transition: transform 0.5s ease-in-out;
}
.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  display: block;
}

.slide-content{
  position: absolute;
  inset-inline: 0;                 /* 等价 left:0; right:0 */
  bottom: 0;
  width: auto;
  box-sizing: border-box;

  padding-inline: clamp(0.8rem, 1.4vw, 1.2rem);
  padding-block: clamp(0.4rem, 1.0vw, 0.85rem); /* 上下稍收紧 */

  color: #fff;
  background-color: rgba(0, 0, 0, 0.5);
  text-shadow: 0.125rem 0.125rem 0.25rem rgba(0,0,0,0.5);

  z-index: 2;
}

.carousel-wrapper .slide-content h1{
  font-size: clamp(0.95rem, 1.0vw, 1.125rem);
  line-height: 1.35;
  margin: 0;

  font-weight: 500;
  color: #f2f6fb;

  /* ★ 关键：让文字块铺满 overlay 宽度 */
  max-width: none;

  /* ★ 关键：真正两端对齐 */
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* 导航按钮样式 */
.carousel-btn {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-transition: background 0.3s ease;
  transition: background 0.3s ease;
  z-index: 10;
  -webkit-appearance: none;
  /* 移除 Safari 默认样式 */
  appearance: none;
}
.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}
.carousel-btn-prev {
  left: 20px;
}
.carousel-btn-next {
  right: 20px;
}
/* ============================================
   关于实验室区域样式
============================================= */
.about {
  margin-top: 20px;
  /* 顶部间距 */
  background-color: #fff;
  /* 白色背景 */
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  /* 弹性布局，图片和文字并排 */
  padding: 15px;
  /* 内边距 */
  /* 实验室负责人或团队照片 */
  /* 文字内容区域 */
}
.about img {
  width: 20%;
  /* 固定宽度 */
  height: auto;
  -webkit-align-self: flex-start;
  align-self: flex-start;
  -o-object-fit: cover;
  object-fit: cover;
}
.about .txt {
  margin-left: 0.5em;
  /* 左外边距，与图片分隔 */
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  /* 段落样式 */
}
.about .txt p {
  text-indent: 0em;
  /* 首行缩进2个字符 */
  margin-top: 0.25em;
  /* 顶部间距 */
  word-break: break-word;
  /* Safari 文本换行优化 */
}
/* About 最后一行 CTA */
.about .txt .about-cta{
  text-align: center;     /* 强制居中 */
  font-size: 1.3rem;     
  margin-top: 0.2rem;
}

.about .txt .about-cta strong{
  font-weight: 700;
}

/* ============================================
   特色发表区域样式
============================================= */
.featured {
  background-color: #fff;
  /* 白色背景 */
  /* 图片展示区域 */
  /* 分隔线 */
  /* 视频展示区域 */
}

/* 1) 三个一行，每个占 28%，剩余空间均分到间隔和两侧 */
.featured .imgs{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0rem;          /* 可按需调小，比如 1rem */
  padding: 1.2rem;
}

/* 2) 每个 hoverImg 固定占 24% 宽度（不写死高度） */
.featured .imgs a.hoverImg{
  flex: 0 0 24%;
  width: 24%;
  height: auto;          /* ★ 覆盖全局 hoverImg 的 height:100% */
  overflow: hidden;
  background: #fff;      /* 可选：留白更干净 */
  display: block;
}

/* 3) 图片回到“正常流”，让它用自身比例自然撑开高度 */
.featured .imgs a.hoverImg img{
  position: static;      /* ★ 关键：不要 absolute */
  width: 100%;
  height: auto;          /* ★ 关键：自然撑高 */
  display: block;
  object-fit: contain;   /* 可选：对 img 本身影响不大，因为 height:auto */
}

.featured .line {
  background-color: #999;
  /* 灰色 */
  height: 2px;
  /* 高度 */
  width: 100%;
  /* 占满容器宽度 */
  margin: 20px 0;
  /* 上下外边距 */
}
.featured .videos {
  display: -webkit-grid;
  display: grid;
  /* 网格布局 */
  gap: 40px;
  /* 网格间距 */
  padding: 20px;
  /* 内边距 */
  -webkit-grid-template-columns: repeat(2, 1fr);
  grid-template-columns: repeat(2, 1fr);
  /* 两列等宽网格 */
  /* 视频元素样式 */
}
.featured .videos video {
  width: 100%;
  /* 占满网格列宽度 */
  height: 260px;
  /* 固定高度 */
  -o-object-fit: contain;
  object-fit: contain;
  -webkit-transform: translateZ(0);
  /* Safari 视频渲染优化 */
  transform: translateZ(0);
}
.featured .videos iframe{
  width: 100%;
  aspect-ratio: 16 / 9; /* 像图片一样跟宽度缩放 */
  height: auto;         /* 不要固定 260px */
  border-radius: 8px;
}

/* ============================================
   合作伙伴区域样式
============================================= */
.partner {
  min-height: 350px;
  /* 最小高度 */
  background-color: #fff;
  /* 白色背景 */
  margin-bottom: 20px;
  /* 底部间距 */
  padding: 20px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 30px;
  /* 合作伙伴 Logo */
}
.partner img {
  max-width: 150px;
  max-height: 80px;
  -o-object-fit: contain;
  object-fit: contain;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
  opacity: 0.7;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
}
.partner img:hover {
  -webkit-filter: grayscale(0%);
  filter: grayscale(0%);
  opacity: 1;
}

/* =========================
   About (general, all browsers)
   ========================= */
	.about{
	  display: flex;
	  align-items: stretch; /* ★ 关键：左右等高 */
	  gap: 1.1rem;
	  padding: 1.1rem;
	  background-color: #fff;
	}

	/* 左侧图片列：本身等高 */
	.about .about-media{
	  flex: 0 0 15%;
	  width: 15%;
	  display: flex;
	  align-items: stretch;
	}

	/* 图片填充左列高度 */
	.about .about-media img{
	  width: 100%;
	  height: 100%;         /* ★ 现在 100% 有参照：about-media 的高度 */
	  object-fit: contain;
	  display: block;
	  border-radius: 0.4rem;
	}

	/* 标题与强调 */
	.about .about-title{
	  font-weight: 600;
	  line-height: 1.3;
	  font-size: 1.3em;
	}
	.about .about-title .apex-letter{
	  font-weight: 800;
	  font-size: 1.1em;
	  letter-spacing: 0 em;
	  display: inline-block;
	}

	/* =========================
	   About text height tuning
	   ========================= */
	.about .txt p{
	  font-size: 1 rem;      /* ★ 比 body(1rem) 略小 */
	  line-height: 1.5;       /* ★ 压缩行距 */
	  margin-top: 0.7rem;
	  text-indent: 0;
	  text-align: justify;
	  text-justify: inter-word;
	  hyphens: auto;
	  overflow-wrap: break-word;
	}
	.about-intro{
	  font-size: 1.1rem;   /* ★ 稍微放大一点（推荐区间 1.03–1.08） */
	  line-height: 1.55;    /* 保持学术阅读舒适度 */
	}
	.about-intro .x-mark{
/*	  color: #527BBD;*/
	  font-size: 1.15em;    /* 相对正文再略微强调 */
	  font-weight: 700;
	}

/* Safari 特定修复 */
@media not all and (min-resolution: 0.001dpcm) {
@supports (-webkit-appearance:none) {
/* 网格布局回退方案 - 针对旧版 Safari */
	.featured .imgs,
	.featured .videos {
	  display: -webkit-flex;
	  display: flex;
	  -webkit-flex-wrap: wrap;
	  flex-wrap: wrap;
	}
	.featured .imgs a,
	.featured .videos a,
	.featured .imgs video,
	.featured .videos video {
	  -webkit-box-flex: 1;
	  -webkit-flex: 1 1 calc(33.333% - 20px);
	  flex: 1 1 calc(33.333% - 20px);
	  margin: 10px;
	  min-width: 250px;
	}
	.featured .videos video {
	  -webkit-flex: 1 1 calc(50% - 40px);
	  flex: 1 1 calc(50% - 40px);
	}
	/* 关于区域修复 */
	/* About section layout */
	/* About section layout */
	/* gap 属性回退 */
	.partner {
	  margin: -15px;
	}
	.partner img {
	  margin: 15px;
	}
}
}

.about .apex-acronym{
  white-space: nowrap;
}

/* 针对 Safari 15+ 的优化 */
@supports (-webkit-touch-callout: none) {
  .carousel-btn {
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .slide-content {
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
  }
  /* 改善 Safari 中的滚动性能 */
  .carousel-wrapper,
  .featured .imgs a img {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .carousel-slide img,
  .featured .imgs img,
  .partner img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* === Safari carousel misalignment fix === */

/* 1) container 必须裁切 */
.carousel-container{
  overflow: hidden;
}

/* 2) wrapper：强制无间隙、稳定 transform */
.carousel-wrapper{
  display: flex;
  gap: 0;                 /* 防止出现“隐形列间距” */
  will-change: transform; /* Safari 更稳 */
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
}

/* 3) slide：不要用 min-width，改用 flex-basis 固定 100% */
.carousel-slide{
  flex: 0 0 100%;         /* ✅ 每张严格占满一屏宽 */
  width: 100%;
  min-width: 0;           /* 防止内容撑破 */
}

/* 4) img：保持你想要的裁切策略 */
.carousel-slide img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 需要完整显示就改 contain */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

