/* ==========================================================================
   1. Fonts and Root Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,700;1,8..60,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
@import url('https://fonts.google.com/css2?family=Inter:wght@100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: fallback;
  src: url("../wp-content/themes/twentytwentyfive/assets/fonts/manrope/Manrope-VariableFont_wght.woff2") format("woff2");
}

:root {
  --font-family-heading: "Lora", "Times New Roman", serif;

  --font-family-base: "Inter", sans-serif;
  --font-family-mono: "Fira Code", monospace;
  --font-size-base: 16px;
  --font-size-sm: 0.875rem;
  --font-size-md: clamp(1rem, 1rem + ((1vw - 0.2rem) * 0.196), 1.125rem);
  --font-size-lg: clamp(1.125rem, 1.125rem + ((1vw - 0.2rem) * 0.392), 1.375rem);
  --font-size-xl: clamp(1.75rem, 1.75rem + ((1vw - 0.2rem) * 0.392), 2rem);
  --font-size-xxl: clamp(2.15rem, 2.15rem + ((1vw - 0.2rem) * 1.333), 3rem);

  --color-base: #ffffff;
  --color-contrast: #111111;
  --color-accent-2: #f6cff4;
  --color-accent-4: #686868;
  --color-primary: #5A67D8;
  /* Added for link consistency */

  --spacing-20: 10px;
  --spacing-30: 20px;
  --spacing-50: clamp(10px, 3vw, 25px);
  --spacing-60: clamp(20px, 4vw, 40px);
  --spacing-80: clamp(70px, 10vw, 140px);
  --spacing-xxl: 6rem;

  --max-width-wide: 1600px;
  --transition-fast: 150ms ease-in-out;
  --border-radius: 12px;
}

/* ==========================================================================
   2. Global Resets and Base Styles (FINAL FONT FIX)
   ========================================================================== */

/* ... (*, html, etc. remain the same) ... */

body {
  margin: 0;
  /* ★★★ 默认所有文字都使用 Montserrat ★★★ */
  font-family: var(--font-family-base);

  line-height: 1.7;
  font-weight: 400;
  /* Montserrat 的常规字重 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background-color: var(--color-base);
  color: var(--color-contrast);
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

video {
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 0;
  text-align: justify;
}

p+p {
  margin-top: var(--spacing-20);
}

/* 
  ★★★ 关键：确保所有标题都使用 Playfair Display ★★★
  这个规则应该放在 body 规则的后面
*/
h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.about-name,
.card__title,
.research-category__title,
.footer-nav__title {
  font-family: var(--font-family-heading);
  font-weight: 700;
  /* Lora 的 700 (Bold) 字重效果很好 */
}

/* 
  ★★★ 关键：确保列表项也使用正文字体 ★★★
  为了保险起见，我们再次明确定义
*/
.feature-list li {
  font-family: var(--font-family-base);
}

/* ==========================================================================
     3. Main Layout Components
     ========================================================================== */

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

.site-header {
  background-color: transparent;
  position: absolute;
  width: 100%;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

body:not(.homepage) .site-header {
  position: static;
  background-color: #FFFFFF;
  border-bottom: 1px solid #EAEAEA;
}

.site-header--transparent {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed;
  border-bottom: 1px solid #EAEAEA;
}

.site-header__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0.5rem clamp(var(--spacing-30), 5vw, var(--spacing-80));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-50);
}

.site-title {
  font-size: var(--font-size-xxl);
  font-weight: 700;
}

.site-logo {
  display: block;
  max-width: 150px;
}

.site-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.section {
  padding-block: var(--spacing-60);
}

.layout-wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding-inline: clamp(var(--spacing-30), 5vw, var(--spacing-80));
}

.layout-full-bleed {
  width: 100%;
  max-width: 100%;
  padding-inline: 0;
  text-align: center;
}

.section-title {
  margin: 0 0 var(--spacing-50);
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.section--light-gray {
  background-color: #F7F9FA;
}

.site-footer {
  background-color: #f5f5f5;
  border-top: 1px solid #eaeaea;
}

.site-footer__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 3.5rem clamp(var(--spacing-30), 5vw, var(--spacing-80));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3rem;
}

.footer-slogan {
  max-width: 800px;
  line-height: 1.3;
}

.footer-slogan__line {
  color: #333;
}

.footer-slogan__line:first-child {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-slogan__line:last-child {
  font-size: 1.75rem;
  font-weight: 500;
}

.footer-nav {
  display: flex;
  align-items: center;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-join-us {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
  text-decoration: none;
}

.footer-join-us:hover {
  background-color: color-mix(in srgb, var(--color-primary) 85%, black);
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  .footer-slogan {
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
     4. Reusable Components
     ========================================================================== */

/* --- Split Layout --- */
.split {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-50);
  align-items: center;
  margin-top: var(--spacing-50);
}

.split--align-top {
  align-items: flex-start;
}

.split__media,
.split__content {
  flex: 1 1 320px;
  min-width: 0;
}

.split--reverse {
  flex-direction: row-reverse;
}

.split__content--align-right {
  text-align: right;
  align-items: flex-end;
}

.split__content--align-left {
  text-align: left;
  align-items: flex-start;
}

.split__content--align-middle {
  text-align: center;
  align-items: center;
}

/* --- Buttons --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  padding: 1rem 2.25rem;
  transition: background-color var(--transition-fast);
}

.button--outline {
  background: transparent;
  border: 1px solid currentColor;
  padding: calc(1rem - 1px) calc(2.25rem - 1px);
}

.button--outline:hover {
  background-color: color-mix(in srgb, var(--color-contrast) 5%, transparent);
}

.split__content .button {
  margin-top: 1rem;
}

.button--primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border: none;
  font-weight: 700;
}

.button--primary:hover {
  background-color: color-mix(in srgb, var(--color-primary) 85%, black);
  text-decoration: none;
}

/* --- Galleries --- */
.inline-gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1.5rem;
}

.inline-gallery__item {
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
}

.inline-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-gallery {
  display: grid;
  gap: 1rem;
  padding: 2rem 0;
  grid-template-columns: repeat(6, 1fr);
}

.thumb-gallery__item {
  display: block;
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.thumb-gallery__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.thumb-gallery__item--landscape {
  aspect-ratio: 4 / 3;
}

.thumb-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ==========================================================================
     5. UNIFIED & TARGETED MEDIA STYLES (FINAL VERSION)
     ========================================================================== */

/* --- General Frame Styling --- */
.media-frame,
.video-container {
  margin: 0 auto;
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: auto;
  display: block;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Sizing for items INSIDE a .split layout --- */
.split .media-frame,
.split .video-container {
  max-width: 640px;
}

.has-uniform-media .split .media-frame img,
.has-uniform-media .split .media-frame video {
  width: 100%;
  height: auto;
}

/* --- Exception for Portrait Posters --- */
.split .media-frame--portrait {
  max-width: 380px;
  aspect-ratio: auto;
}

.split .media-frame--portrait img {
  max-height: 70vh;
  height: auto;
  object-fit: contain;
}

/* ==========================================================================
     6. Plugins Specific Styles (Swiper, lightGallery)
     ========================================================================== */

/* --- Swiper --- */
.swiper {
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
}

.swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-service-slider {
  width: 100%;
  max-width: 1500px;
  height: 420px;
  margin-left: auto;
  margin-right: auto;
}

.community-service-slider .swiper-button-next,
.community-service-slider .swiper-button-prev {
  color: #ffffff;
}

.community-service-slider .swiper-pagination-bullet-active {
  background-color: #ffffff;
}

.chess-volunteer-slider {
  width: 100%;
  height: 420px;
}

.chess-volunteer-slider .swiper-button-next,
.chess-volunteer-slider .swiper-button-prev {
  color: #333;
}

.chess-volunteer-slider .swiper-pagination-bullet-active {
  background-color: #333;
}

/* --- lightGallery --- */
.lg-image {
  max-width: 80% !important;
  max-height: 80vh !important;
}

/* ==========================================================================
     7. Animation Styles
     ========================================================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.8s ease-out;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
     8. Page Specific Styles
     ========================================================================== */

/* --- Homepage Hero Section (NEW OVERLAY LAYOUT) --- */
.hero-section-home {
  position: relative;
  /* 1. 建立一个定位基准，让文字层可以基于它来定位 */
  height: 50vh;
  /* 2. 设置一个期望的英雄区高度，例如视窗高度的80% */
  color: #FFFFFF;
  /* 3. 将默认文字颜色设为白色，以确保可读性 */
}

.hero-section__background {
  /* 4. 图片层：作为背景，铺满整个容器 */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-section__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 5. 关键：让图片填满容器，同时保持比例、裁剪多余部分 */
}

.hero-section__content-below {
  /* 6. 文字层：同样铺满整个容器，浮于图片之上 */
  position: relative;
  /* z-index会生效，且依然是flex容器 */
  z-index: 2;
  /* 确保文字层在图片层之上 */
  width: 100%;
  height: 100%;

  /* 7. 添加一个半透明的深色遮罩，让白色文字更清晰 */
  background-color: rgba(17, 17, 17, 0.6);

  /* 8. 使用 Flexbox 将内部文字内容在垂直和水平方向上都完美居中 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-sizing: border-box;
  align-items: center;
}

/* --- 文字样式调整 --- */
.hero-section__content-below .layout-wide {
  padding-inline: 0;
  width: 100%;
  max-width: 100%;
}

.hero-title-below {
  line-height: 1.3;
  max-width: 900px;
  /* 限制一下文字最大宽度，避免在宽屏上拉得太长 */
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  /* 可以适当放大字体 */
  text-align: center;
}

.hero-title-below span {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 确保"OUR MISSION"和线条居中 */
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.5rem;
}

.hero-title-below span::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.5);
  margin-right: 1rem;
}

.hero-title-below span::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.5);
  margin-left: 1rem;
}

/* --- "About Me" Section --- */
.split .about-image-frame {
  max-width: 300px;
  /* ★★★ 从 450px 缩小到 380px ★★★ */
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.about-name {
  font-size: var(--font-size-xl);
  font-weight: 800;
  margin: 0;
}

.about-tagline {
  font-size: var(--font-size-md);
  color: var(--color-accent-4);
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  max-width: 55ch;
}

.feature-list {
  /* 
      我们不再需要 list-style: none;
      padding-left 给了圆点和左侧边缘之间的空间
    */
  padding-left: 1.5rem;
  /* 约 24px */
  margin: 0 0 2rem;

  /* 移除 grid 布局，回归标准的列表流 */
}

.feature-list li {
  /* 
      为每个列表项的下方增加一点间距，让列表不那么拥挤
    */
  margin-bottom: 0.5rem;
  /* 约 8px */
  padding-left: 0.5rem;
  /* ★★★ 关键：在圆点和文字之间创建空间 ★★★ */
  font-weight: 500;
}

/* --- "Research & Essays" Section --- */
.section-header {
  text-align: start;
}

.section-header__primary {
  font-weight: 800;
  margin: 0;
  font-size: 2.5rem;
  /* ★ 关键：将字体大小增加到 2.5rem (约 40px) */
  margin-bottom: 3rem;
  /* ★ 新增：在主标题下方增加足够的间距 */
}

.section-header__secondary {
  text-align: center;
  font-size: 1.5rem;
  /* ★ 关键：将字体大小调整为 1.5rem (约 24px) /
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1.5px;
color: var(--color-contrast); / 保持黑色以确保清晰 */
  margin-bottom: 2.5rem;
}

.research-category {
  padding-top: 4rem;
}

.research-category:first-of-type {
  padding-top: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background-color: var(--color-base);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.card__image-wrapper {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card__image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.card__links {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  gap: 1rem;
}

.card__links a {
  font-weight: 600;
  text-decoration: none;
  color: var(--color-primary);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.card__links a:hover {
  border-bottom-color: var(--color-primary);
}

.research-category .split h4 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0 0 1rem;
}

/* --- Sub-page Styles --- */
.subpage-hero {
  padding-block: 4rem;
  text-align: center;
}

.subpage-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  margin: 0 0 1rem;
}

.section-subtitle {
  text-align: center;
  font-size: var(--font-size-md);
  color: var(--color-accent-4);
  max-width: 60ch;
  margin: 0 auto 2rem;
}

.page-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.page-title+.section-lead {
  margin-top: 2rem;
}

.layout-content {
  max-width: 1024px;
  margin-left: auto;
    /* ★ 新增：左外边距自动 */
    margin-right: auto;
    /* ★ 新增：右外边距自动 */
}

.layout-content h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-accent-2);
  padding-bottom: 0.5rem;
}

.layout-content p {
  margin-bottom: 1rem;
}

.full-width-image {
  width: 100vw;
  max-width: 1200px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-block: 2rem;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.full-width-image figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-accent-4);
  text-align: center;
  margin-top: 0.5rem;
}

.media-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-block: 2rem;
}

/* When using embedded players, avoid forcing children to a fixed aspect via media-gallery rules */
.media-gallery.embedded-videos > * {
  max-width: 100%;
}

.media-gallery__item {
  flex-basis: calc(33.333% - 1rem);
  flex-grow: 1;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.media-gallery__item:hover {
  transform: translateY(-5px);

/* --- Video-specific thumbnail modifiers --- */
.thumb-gallery__item--nocrop {
  /* disable enforced aspect ratio so item can keep its natural dimensions */
  aspect-ratio: auto !important;
  overflow: visible; /* allow iframe to fill without hidden clipping if needed */
}

.thumb-gallery__item--nocrop img {
  /* keep the full image visible without cropping */
  object-fit: contain !important;
  height: auto !important;
}

.thumb-gallery__item--span {
  /* span multiple grid cells to create an irregular masonry-like layout */
  grid-column: span 2;
  grid-row: span 2;
}

@media (max-width: 900px) {
  /* On smaller screens, avoid spanning to preserve readability */
  .thumb-gallery__item--span {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* Wrapper for inline replaced iframe that preserves the original thumbnail size */
.inline-video-wrapper {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   LightGallery: add a little top offset so the lightbox appears slightly lower
   than center (prevents it from overlapping page header visually).
   Uses high specificity and !important to override plugin defaults safely.
   -------------------------------------------------------------------------- */
.page-me .lg-inner {
  /* add a top margin to the lightGallery inner content on the me page */
  margin-top: 2.5rem !important;
}

@media (max-width: 600px) {
  .page-me .lg-inner {
    margin-top: 1rem !important;
  }
}
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.media-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-gallery a[href*="youtube.com"]::after,
.media-gallery a[href*="youtu.be"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0' 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-size: 24px;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

.media-gallery a[href*="youtube.com"]:hover::after,
.media-gallery a[href*="youtu.be"]:hover::after {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: rgba(0, 0, 0, 0.7);
}

/* --- Team Members Grid --- */

.team-grid {
  display: grid;
  /* Use auto-fit so grid centers and adapts to container width */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  justify-items: center; /* center each grid cell horizontally */
}

.team-member {
  text-align: center;
  max-width: 280px; /* avoid overly wide member cards */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-member img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.team-member__info {
  display: flex;
  flex-direction: column;
}

.team-member__info strong {
  font-weight: 700;
}

.team-member__info span {
  font-size: var(--font-size-sm);
  color: var(--color-accent-4);
}

/* --- Image Grid 1+3 --- */
.image-grid-1plus3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.image-grid-1plus3 .image-grid__main {
  grid-column: 1 / 4;
  border-radius: 8px;
  overflow: hidden;
}

.image-grid-1plus3 .image-grid__main img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  display: block;
}

.image-grid-1plus3 .image-grid__thumb {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
}

.image-grid-1plus3 .image-grid__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Featured Media Grid --- */
.featured-media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-block: 2rem;
}

.featured-media__item {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.featured-media__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.featured-media__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-media__item--view-all {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f0f4ff;
  color: var(--color-primary);
  font-weight: 700;
}

.featured-media__item--view-all span {
  font-size: 2rem;
}

.featured-media__item--view-all small {
  font-size: 0.875rem;
}

.featured-media__item--video::after,
.featured-media__item[data-src]::after {
  content: none;
}


/* ==========================================================================
     11. Responsive Media Queries
     ========================================================================== */

@media (max-width: 1024px) {

  .site-header__inner,
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 900px) {
  .hero-section-home {
    flex-direction: column;
    /* 在小屏幕上，从左右布局变为上下堆叠 */
    padding-top: 80px;
    align-items: stretch;
    /* 确保宽度撑满 */
  }

  .hero-section__background {
    height: 50vh;
    flex-basis: auto;
  }

  .hero-section__content-below {
    flex-basis: auto;
    min-height: 50vh;
    align-items: center;
    text-align: center;
  }

  .hero-title-below span {
    justify-content: center;
  }

  .split {
    flex-direction: column;
    align-items: stretch;
  }

  .split__content,
  .split__content--align-right {
    align-items: flex-start;
    text-align: left;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .media-gallery__item {
    flex-basis: calc(50% - 0.5rem);
  }
}

@media (max-width: 900px) {
  /* Make team grid two columns on medium screens */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 900px;
  }
}

@media (max-width: 600px) {
  .team-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .thumb-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .media-gallery__item {
    flex-basis: 100%;
  }

  .thumb-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Embedded videos grid (pages that use .embedded-videos)
   Ensure embedded iframes have a sensible size and form a responsive grid.
   Desktop: 3 columns (first row 3 items, second row 2 items for 5 videos),
   Tablet: 2 columns, Mobile: 1 column
   -------------------------------------------------------------------------- */
.media-gallery.embedded-videos {
  /* disable the default media-gallery flex layout when we embed players */
  display: block;
}

.embedded-videos .split {
  display: grid;
  /* Default to 3 columns so five items render as 3 on the first row and 2 on the second */
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
  grid-auto-rows: 1fr; /* keep rows balanced so players have similar heights */
}

.embedded-videos .split__media {
  /* make each cell a block-level context for the responsive video */
  display: block;
  width: 100%;
}

.embedded-videos .video-container {
  /* keep the aspect ratio technique and ensure the container fills the grid cell */
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  width: 100%;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.embedded-videos .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (min-width: 1400px) {
  /* On very wide screens increase spacing for breathing room */
  .embedded-videos .split {
    gap: 1.25rem;
  }
}

@media (max-width: 900px) {
  /* Tablet & small desktops: use two columns */
  .embedded-videos .split {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  /* Mobile: single column stack */
  .embedded-videos .split {
    grid-template-columns: 1fr;
  }
}

/* Page-specific: force 2x2 grid on the Scientific Innovation Research page */
.video-grid-2x2-page .split {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.video-grid-2x2-page .split__media {
  width: 100%;
}

.video-grid-2x2-page .video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-grid-2x2-page .video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 900px) {
  .video-grid-2x2-page .split {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .video-grid-2x2-page .split {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Hide common author/byline selectors appearing inside the article content.
   We scope to .layout-content to avoid removing site branding like the footer
   site title unless it is placed inside page content.
   -------------------------------------------------------------------------- */
.layout-content .byline,
.layout-content .author,
.layout-content .author-name,
.layout-content .post-meta,
.layout-content .post-meta__author,
.layout-content .article-author,
.layout-content .entry-author,
.layout-content .post-author {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Thumbnail grid for documentary page: embedded-thumb-grid
   Keep the existing links and images, but present them as 3 columns on desktop
   (so five items will appear 3 + 2), 2 columns on tablet, 1 column on mobile.
   Ensure images keep their intrinsic aspect ratio and are not cropped.
   -------------------------------------------------------------------------- */
.media-gallery.embedded-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
}

.media-gallery.embedded-thumb-grid .media-gallery__item {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #000; /* placeholder while images load */
}

.media-gallery.embedded-thumb-grid .media-gallery__item img {
  display: block;
  width: 100%;
  height: auto; /* preserve aspect ratio */
  object-fit: contain; /* don't crop */
}

@media (max-width: 900px) {
  .media-gallery.embedded-thumb-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .media-gallery.embedded-thumb-grid {
    grid-template-columns: 1fr;
  }
}

/* Documentary page: first row 3 items, second row 2 items, centered */
.split.video-3-2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* center items on each wrapped row */
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.split.video-3-2 .split__media {
  /* three columns layout by default */
  flex: 0 0 calc((100% - 2rem) / 3);
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .split.video-3-2 .split__media {
    flex: 0 0 calc((100% - 1rem) / 2);
  }
  .split.video-3-2 {
    max-width: 800px;
  }
}

@media (max-width: 600px) {
  .split.video-3-2 .split__media {
    flex: 0 0 100%;
  }
  .split.video-3-2 {
    max-width: none;
  }
}

/* ==========================================================================
     12. Call to Action (CTA) Box for Links
     ========================================================================== */

.cta-box {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: #f0f4ff;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-top: 3rem;
  text-decoration: none;
  color: var(--color-contrast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-box:hover {
  text-decoration: none;
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(89, 103, 216, 0.15);
}

.cta-box__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  color: var(--color-primary);
}

.cta-box__text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.cta-box__arrow {
  margin-left: auto;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  transition: transform 0.2s ease;
}

.cta-box:hover .cta-box__arrow {
  transform: translateX(5px);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  /* ★★★ 关键：让网格的行高度自动调整 ★★★ */
  grid-auto-rows: 1fr;
}

.content-grid__item {
  display: grid;
  gap: 1.5rem;
  grid-template-rows: auto 1fr;
}

.content-grid .split__media {
  flex: 0 0 40%;
}

.content-grid .split__content {
  flex: 1;
}

.content-grid__item-body {
  display: flex;
  flex-direction: column;
}

.content-grid__item-body h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0;
}

.content-grid__item-body p {
  color: var(--color-accent-4);
  font-size: var(--font-size-sm);
  margin-top: 0.5rem;
  flex-grow: 1;
}

.content-grid__item-body .button {
  justify-self: start;
  margin-top: 1.5rem;
}

/* ==========================================================================
   14. EXCEPTION FOR PORTRAIT FRAMES (FINAL & CORRECTED SELECTOR)
   ========================================================================== */

/* 
  ★★★ 关键：使用更具体的选择器来提高优先级 ★★★
  这个规则现在和 .has-uniform-media 规则一样具体了
*/
.has-uniform-media .split .media-frame--portrait {
  /* 覆盖掉 16:9 的比例 */
  aspect-ratio: auto;

  /* 覆盖掉 .split__media 的 flex-basis: 40% */
  /* 我们不再需要 !important 了 */
  flex-basis: 35%;
  max-width: 380px;
  /* 给一个更合适的最大宽度 */
}

/* 
  这条规则确保竖向海报内部的图片能完整显示
  选择器也变得更具体
*/
.has-uniform-media .split .media-frame--portrait img {
  height: auto;
  object-fit: contain;
  max-height: 70vh;
  /* 限制最大高度 */
}

/* ==========================================================================
   X. PLAY ICON OVERLAY FOR VIDEO LINKS (FINAL FIX)
   ========================================================================== */

/* 
  确保 .media-gallery__item 是一个定位上下文，
  这样我们才能把图标精确定位在它的正中间。
*/
.media-gallery__item {
  position: relative;
  /* ★★★ 确保这一行存在 ★★★ */
}

/* 
  为所有指向 YouTube 的链接添加一个播放图标伪元素
*/
.media-gallery a[href*="youtube.com"]::after,
.media-gallery a[href*="youtu.be"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 50px;
  height: 50px;

  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;

  /* 这是嵌入式的 SVG 三角形图标 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-size: 24px;
  background-position: center;
  background-repeat: no-repeat;

  transition: transform 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
  /* 确保图标不会干扰对链接的点击 */
  opacity: 0.8;
  /* 让图标稍微半透明，不那么突兀 */
}

/* 鼠标悬停时，图标变大、背景变深 */
.media-gallery a[href*="youtube.com"]:hover::after,
.media-gallery a[href*="youtu.be"]:hover::after {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: rgba(0, 0, 0, 0.7);
  opacity: 1;
}

/* ==========================================================================
   X. About Me (me.html) Page Specific Styles
   ========================================================================== */

/* --- 2-Column Image Grid for "My Background" --- */
.image-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 精确的两列 */
  gap: 1.5rem;
  /* 图片之间的间距 */
  margin-block: 2rem;
  /* 与上下文的间距 */
}

.image-grid-2col .media-frame {
  margin: 0;
  /* 移除 .media-frame 的默认 auto margin */
}

/* 调整子页面中 H3 标题的样式 */
.layout-content h3 {
  font-size: 1.5rem;
  /* 24px */
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   X. Scrolling Gallery Component
   ========================================================================== */

.scrolling-gallery {
  display: flex;
  /* ★★★ 关键：使用 Flexbox 让图片横向排列 ★★★ */
  gap: 1rem;
  /* 图片之间的间距 */

  /* 创建一个可以横向滚动的容器 */
  overflow-x: auto;
  /* ★★★ 关键：允许内容在 X 轴（水平）上滚动 ★★★ */
  -webkit-overflow-scrolling: touch;
  /* 在移动端实现平滑的滚动效果 */

  /* 为滚动区域增加一点内边距，让图片不紧贴边缘 */
  padding: 0.5rem;

  /* 美化滚动条 (在支持的浏览器中) */
  scrollbar-width: thin;
  scrollbar-color: #ccc #f0f0f0;
}

.scrolling-gallery::-webkit-scrollbar {
  height: 8px;
  /* 滚动条高度 */
}

.scrolling-gallery::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.scrolling-gallery::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

/* 
    为画廊中的每个项目（图片）设置尺寸
  */
.scrolling-gallery__item {
  flex-shrink: 0;
  /* ★★★ 关键：防止图片被压缩变形 ★★★ */

  /* 设置一个固定的高度，宽度自适应 */
  height: 250px;
  /* 你可以根据喜好调整这个高度 */

  border-radius: var(--border-radius, 12px);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scrolling-gallery__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.scrolling-gallery__item img {
  height: 100%;
  width: auto;
  /* ★★★ 关键：宽度自动，保持原始比例 ★★★ */
  display: block;
}

/* ==========================================================================
   X. Full Bleed Gallery Component
   ========================================================================== */

.full-bleed-gallery {
  width: 60vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);

  max-width: none;
  margin-block: 3rem;

  /* ★★★ 关键：在这里添加左右内边距 ★★★ */
  padding-inline: 2rem;
  /* 左右各留出 32px 的空白 */
}

/* ==========================================================================
   X. Background Slider (me.html)
   ========================================================================== */

.background-slider {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 500px;
  /* 同时给一个最大高度限制 */
  border-radius: var(--border-radius, 12px);
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.background-slider .swiper-slide {
  /* 移除 slide 自身的背景色，让父容器的背景色透出来 */
  background-color: transparent;
}

.background-slider .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 调整导航按钮和分页器的颜色 */
.background-slider .swiper-button-next,
.background-slider .swiper-button-prev {
  color: #333;
  /* 白色按钮 */
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.background-slider:hover .swiper-button-next,
.background-slider:hover .swiper-button-prev {
  opacity: 1;
}

.background-slider .swiper-pagination-bullet-active {
  background-color: #ffffff;
}

/* ==========================================================================
   X. LEAD PARAGRAPH STYLE
   ========================================================================== */

.section-lead {
  /* ★ 尺寸：比普通段落大，比小标题小 ★ */
  font-size: 1.25rem;
  /* 约 20px */

  /* ★ 字重：使用常规字重，与普通段落区分开 */
  font-weight: 400;

  /* ★ 颜色：比灰色段落更深，接近标题颜色 ★ */
  color: var(--color-contrast);

  /* ★ 间距：与下方的卡片网格拉开距离 ★ */
  margin-bottom: 3rem;
}

/* ==========================================================================
   X. 3-COLUMN FIXED CARD GRID
   ========================================================================== */

/* 
  这个新规则只对被标记了 .card-grid--3-col 的网格生效
*/
.card-grid--3-col {
  /* ★★★ 关键：精确设置为 3 个等宽的列 ★★★ */
  grid-template-columns: repeat(3, 1fr);
}

/* 
  响应式优化：在小屏幕上，让它变回单列，
  以避免卡片被挤得过小。
*/
@media (max-width: 768px) {
  .card-grid--3-col {
    grid-template-columns: 1fr;
    /* 在平板和手机上变为单列 */
  }
}

/* --- Style for the SPECIFIC Padded Chess Bridges Frame --- */
.media-frame--padded {
  padding: 5rem 0;
  /* 为这个特定的容器添加内边距 */
  background-color: var(--color-base);
  /* 确保边框是白色 */
  box-sizing: border-box;
  /* 确保布局不被破坏 */
}

/* ==========================================================================
   XX. Join Us / Contact Form Page Styles
   ========================================================================== */

.contact-section {
  padding-top: var(--spacing-80);
  padding-bottom: var(--spacing-80);
}

.contact-intro,
.form-container {
  text-align: center;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.contact-intro-text p {
  font-size: var(--font-size-md);
  line-height: 1.8;
  color: var(--color-accent-4);
  margin-bottom: 1rem;
}

.form-container {
  margin-top: 4rem;
}

.form-title {
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.contact-form {
  text-align: left;
  /* 让表单内的标签和输入框左对齐 */
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  /* 确保 padding 不会撑破布局 */
  transition: all var(--transition-fast);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

.form-submit {
  text-align: center;
  margin-top: 1rem;
}

/* --- Responsive styles for the form --- */
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
    /* 在小屏幕上，从两列变为单列堆叠 */
    gap: 0;
    /* 移除列间距 */
  }
}

.card__subtitle {
  display: block;
  /* ★★★ 关键：让 span 换行显示 ★★★ */

  font-family: var(--font-family-base);
  /* ★★★ 关键：使用更清晰的正文字体 (Inter) ★★★ */
  font-size: 0.875rem;
  /* ★★★ 关键：使用更小的字号 (14px) ★★★ */
  font-weight: 400;
  /* 使用常规字重，而不是粗体 */

  color: var(--color-accent-4);
  /* 使用柔和的灰色 */
  margin-top: 0.25rem;
  /* 与主标题之间增加一点点间距 */
}