/* --- 全局重置与字体 --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 使用系统字体栈确保跨平台兼容性 */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #fff;
  color: #000;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 为不支持标准字重的浏览器提供备用样式 */
@supports not (font-weight: 700) {
  .uppercase-bold {
    text-shadow: 0 0 1px currentColor;
  }
}

/* 定义容器宽度和边距的 CSS 变量，便于统一管理 */
:root {
  --container-max-width: 1700px;
  --container-padding: 40px;
  --profile-line-spacing: 120px;
  /* 控制 contact-info 和 bio-info 距离 vertical-line 的间距，保证线条居中 */
}

/* 小屏幕自适应间距 */
@media (max-width: 1024px) {
  :root {
    --profile-line-spacing: 60px;
    /* 平板设备：缩小间距 */
  }
}

@media (max-width: 768px) {
  :root {
    --profile-line-spacing: 20px;
    --mobile-grid-gap: 5px;
    /* 手机设备：进一步缩小间距 */
  }
}

@media (max-width: 480px) {
  :root {
    --profile-line-spacing: 10px;
    /* 小屏手机：最小间距 */
  }
}

/* 通用容器：限制最大宽度并居中 */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现白边 */
  display: block;
}

/* 辅助类：大写粗体 */
.uppercase-bold {
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.5px;
}

/* --- 1. 顶部导航 (Header) --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 20px 0;
  font-size: 18px;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

/* 头部内容容器：控制两端分布与垂直居中，自动与通用容器对齐 */
.header-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 补齐固定头部带来的顶部间距，避免内容被遮挡 */
body {
  padding-top: 80px;
}

/* --- 2. 英雄区域 (Logo区) --- */
/* 英雄区域样式：增大上边距和下边距，提供更宽敞的视觉空间 */
.hero-section {
  text-align: center;
  padding: 120px 0 220px 0;
  /* 上下边距容器尺寸 */
  border-bottom: 1px solid #000;
  position: relative;
}

.hero-logo img {
  width: 360px;
  height: 360px;
  object-fit: contain;
  margin: 0 auto;
}

/* "Please contact me" 和 "Personal Profile" 的小字栏 */
.hero-sub-bar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 60px;
  position: absolute;
  /* 贴在底线之上 */
  bottom: 5px;
  left: 0;
  right: 0;
  font-weight: 600;
}

/* --- 3. 个人简介区 (Contact & Bio) --- */
.profile-section {
  display: grid;
  grid-template-columns: 1fr auto 2fr;
  /* 左侧信息 | 分割线 | 右侧简介 */
  gap: var(--profile-line-spacing);
  /* 使用变量统一控制两侧间距，保证线条居中 */
  padding: 60px 0;
  border-bottom: 1px solid #000;
  align-items: stretch;
}

/* 垂直分割线样式 */
.vertical-line {
  background-color: #000;
  /* 线条颜色 */
  width: 1px;
  /* 线条宽度 */
  height: 100%;
  /* 高度占满父容器 */
  margin: 0 auto;
  /* 居中显示 */
}

/* 联系信息区域（左侧） */
.contact-info {
  text-align: center;
  /* 文字居中 */
  justify-self: end;
  /* 在Grid中靠右对齐 */
}

/* 联系信息和简介标题样式 */
.contact-info h2,
.bio-info h2 {
  font-size: 36px;
  /* 标题字体大小 */
  margin-bottom: 20px;
  /* 底部间距 */
  line-height: 1;
}

/* 联系详情文字样式 */
.contact-details p {
  font-weight: 700;
  /* 字体加粗 */
  margin-bottom: 4px;
  /* 段落间距 */
  font-size: 18px;
  /* 文字大小 */
}

/* 二维码容器 - 正方形网格 */
.qr-code-container {
  width: 150px;
  /* 容器宽度 */
  height: 150px;
  /* 容器高度，与宽度相等形成正方形 */
  margin: 20px auto 0;
  /* 上边距20px，水平居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  /* 背景色 */
  border: 1px solid #eee;
  /* 可选：添加边框 */
}

/* 二维码图片样式 */
.qr-code {
  width: 100%;
  /* 图片宽度占满容器 */
  height: 100%;
  /* 图片高度占满容器 */
  object-fit: contain;
  /* 保持图片比例，完整显示 */
  display: block;
}

/* 个人简介区域（右侧） */
.bio-info {
  justify-self: start;
  /* 在Grid中靠左对齐 */
}

/* 个人简介正文样式 */
.bio-text p {
  font-size: 14px;
  /* 正文字体大小 */
  color: #333;
  /* 字体颜色 */
  margin-bottom: 20px;
  /* 每段间距 */
  text-align: justify;
  /* 两端对齐 */
  max-width: 600px;
  /* 最大宽度限制 */
  line-height: 2.0;
  /* 行高 */
}

/* --- 4. 顶部案例 (Top Cases) --- */
/* 顶部案例定制变量：可在其他样式中覆盖，实现尺寸自定义 */
:root {
  --top-cases-max-width: calc(var(--container-max-width) * 1.2);
  /* 容器最大宽度比通用容器大20% */
  --top-cases-padding-block: 0px;
  /* 上下内边距，保持与设计稿一致 */
  --top-cases-padding-inline: 40px;
  /* 左右内边距，方便留白或贴边 */
}

/* 水平滚动区容器，支持自定义尺寸与留白 */
.top-cases-container {
  position: relative;
  width: min(100%, var(--top-cases-max-width));
  margin: 120px auto 0;
  margin-bottom: 180px;
  /* 增加与主要案例区域的间距 */
  overflow: hidden;
  padding: var(--top-cases-padding-block) var(--top-cases-padding-inline);
}

/* 小尺寸屏幕下匹配通用容器宽度与内边距 */
@media (max-width: 1280px) {
  .top-cases-container {
    width: min(100%, var(--container-max-width));
    padding: var(--top-cases-padding-block) var(--container-padding);
  }
}

.top-cases {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 1.5vw, 60px);
  width: 100%;
  padding-bottom: 100px;
}

/* 右列整体下移100px */
.top-cases > *:nth-child(2n) {
  transform: translateY(100px);
}

.case-card {
  display: block;
  width: 100%;
  background: #f4f4f4;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-radius: 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .top-cases {
    grid-template-columns: 1fr;
    gap: var(--mobile-grid-gap);
    padding-bottom: 0;
  }
  /* 移动端取消右列下移效果，让所有卡片正常排列 */
  .top-cases > *:nth-child(2n) {
    transform: translateY(0);
  }
  .top-cases .case-card:nth-child(2) {
    margin-top: 0;
  }
}


.case-image {
  height: 250px;
  background-color: #ccc;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 顶部案例的图片容器：确保所有卡片都是正方形，覆盖通用样式 */
.top-cases .case-image {
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  /* 确保所有顶部案例卡片都是正方形，使用 !important 覆盖所有可能的冲突 */
  background-color: #ccc;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现白边 */
  transition: transform 0.3s ease;
}

.case-card:hover .case-image img {
  transform: scale(1.05);
}

.top-cases .case-card:nth-child(2) {
  margin-top: 0;
}



/* --- 5. 主要案例 (Main Cases) --- */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 80px;
  /* 增加与顶部案例区域的间距 */
  margin-bottom: 150px;
  /* 主要案例与更多案例之间的间距 */
}


/* 基础方形单元格：居中内容并可点击 */
.tile {
  aspect-ratio: 1 / 1;
  /* 正方形格式 */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* 视频格子：全覆盖视频，待点击播放 */
.video-case {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  border-radius: 0px;
}

.video-case video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现黑边 */
  border-radius: 0px;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 0;
  background-color: rgba(231, 231, 231, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease, background-color 0.35s ease;
  opacity: 0.8;
}

.video-case:hover .play-button {
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 0.9;
  background-color: rgba(255, 255, 255, 0.8);
}

.tile img {
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现白边 */
  transition: transform 0.3s ease;
}

.tile:hover img {
  transform: scale(1.05);
}

/* --- 5.5 视频案例 (Video Cases) --- */
.video-cases-section {
  margin-bottom: 150px;
}

.video-cases-header {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 30px;
  text-transform: uppercase;
  text-align: center;
}

/* 如果 More Cases 是居中的，这里也居中可能更好看? */
/* More cases css:
.more-cases-section { text-align: center; ... }
*/
/* 既然是单独的区域，我先设为左对齐，或者看具体效果。
   不过考虑到 mosaic-grid 没有标题，而这个有标题，可能类似 More Cases。
   但我看 Video Cases 像是主要内容的一部分。
   让我们看看 mosaic-grid 的布局。它是直接 grid。
   我将让 header 默认左对齐，如果用户觉得不好看再改。
   Wait, the mosaic grid fills the container.
   I'll make the header text-align: left to start with, or match the section alignment.
*/

.video-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.video-tile {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
}

.video-tile .video-case {
  width: 100%;
  height: 100%;
}

/* 视频案例链接样式 */
.video-case-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.video-case-link .video-case {
  transition: transform 0.3s ease;
}

.video-case-link:hover .video-case {
  transform: scale(1.05);
}

.video-case-link img {
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现白边 */
  transition: transform 0.3s ease;
}

.video-case-link:hover img {
  transform: scale(1.05);
}

/* --- 6. 更多案例 (More cases) --- */
/* 底部小缩略图区域及标题 */
.more-cases-section {
  text-align: center;
  padding-bottom: 120px;
}

.more-cases-header {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 30px;
  text-transform: uppercase;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.footer-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #eee;
  cursor: pointer;
}

.footer-item.no-hover {
  cursor: default;
}

.footer-item img {
  object-fit: cover;
  object-position: center;
  /* 居中等比例填充，不出现白边 */
  transition: transform 0.3s ease;
}

.footer-item:hover img {
  transform: scale(1.05);
}

/* --- 响应式适配 --- */
@media (max-width: 1024px) {
  .mosaic-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .video-cases-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* 小屏个人简介区堆叠显示 */
  .profile-section {
    grid-template-columns: 1fr;
    padding: 60px 0 clamp(20px, 4vw, 30px) 0;
    /* 移动端保持上边距60px，下边距使用响应式值，让与顶部案例的间距更紧凑 */
  }

  .contact-info,
  .bio-info {
    justify-self: center;
    text-align: center;
  }

  .vertical-line {
    display: block;
    width: 100%;
    height: 1px;
    margin: 20px 0;
  }

  .mosaic-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-grid-gap);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    display: none;
  }

  body {
    padding-top: 0;
  }

  /* 移动端顶部案例容器上边距调整，让与简介区域的间距更紧凑 */
  .top-cases-container {
    margin-top: clamp(30px, 5vw, 60px);
    margin-bottom: var(--mobile-grid-gap);
    /* 移动端保持紧凑的间距 */
  }

  /* 移动端主要案例区域上边距调整，保持紧凑 */
  .mosaic-grid {
    margin-top: 0;
  }

  /* 移动端顶部案例保持正方形比例 */
  .top-cases .case-image {
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    /* 移动端也保持正方形，确保所有卡片尺寸一致 */
  }
}

/* 底部小圆点动画/工具类 */
.no-hover {
  box-shadow: none !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  background-color: transparent !important;
  cursor: default !important;
}

.no-hover:hover {
  transform: none !important;
}

.footer-item.no-hover:hover {
  background-color: transparent !important;
}

.flex {
  display: flex;
}

.flex-row {
  flex-direction: row;
}

.gap-2 {
  gap: 0.7rem;
}

.w-4 {
  width: 0.7rem;
}

.h-4 {
  height: 0.7rem;
}

.rounded-full {
  border-radius: 9999px;
}

.bg-blue-700 {
  background-color: #cecece;
}

/* 弹跳动画基础与延迟工具类 */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-25%);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animation-delay-300 {
  animation-delay: -0.3s;
}

.animation-delay-500 {
  animation-delay: -0.5s;
}

/* Slogan */
.slogan {
  padding: 150px 10%;
  text-align: center;
  margin-bottom: 10px;
}

/* 英文标语样式 - 可单独控制字体大小、粗细、行距等 */
.slogan .slogan-en {
  /* 使用 clamp() 实现自适应字体大小：最小 1.5rem，理想值 3.5rem，最大 4rem，根据视口宽度等比例缩放 */
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  /* 字体粗细 */
  line-height: 1;
  /* 行距 */
  margin-top: 0;
  /* 上边距 */
  margin-bottom: 30px;
  /* 下边距，控制英文和中文之间的间距 */
  letter-spacing: 0.03em;
  /* 字母间距 */
  text-transform: uppercase;
  /* 强制英文全部大写：如需启用，去掉下行的注释 */
}

/* 中文标语样式 - 可单独控制字体大小、粗细、行距等 */
.slogan .slogan-cn {
  /* 使用 clamp() 实现自适应字体大小：最小 1rem，理想值 1.5rem，最大 2rem，根据视口宽度等比例缩放 */
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 900;
  /* 字体粗细 */
  line-height: 1.5;
  /* 行距 */
  margin-top: 0;
  /* 上边距 */
  margin-bottom: 0;
  /* 下边距 */
  letter-spacing: 0.2em;
  /* 字符间距 */
}

/* 响应式适配 - 针对不同屏幕尺寸的精细调整 */
@media (max-width: 1024px) {

  /* 平板设备：中等屏幕尺寸 */
  .slogan {
    padding: 80px 8%;
    /* 减少内边距 */
  }

  .slogan .slogan-en {
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    /* 平板设备下的英文字体大小 */
    margin-bottom: 25px;
    /* 调整间距 */
  }

  .slogan .slogan-cn {
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    /* 平板设备下的中文字体大小 */
  }
}

@media (max-width: 768px) {

  /* 手机设备：小屏幕尺寸 */
  .slogan {
    padding: 60px 5%;
    /* 进一步减少内边距 */
  }

  .slogan .slogan-en {
    font-size: clamp(1rem, 5vw, 2rem);
    /* 手机设备下的英文字体大小 */
    margin-bottom: 20px;
    /* 调整间距 */
    letter-spacing: 0.02em;
    /* 减小字母间距以适应小屏幕 */
  }

  .slogan .slogan-cn {
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    /* 手机设备下的中文字体大小 */
    letter-spacing: 0.15em;
    /* 减小字符间距以适应小屏幕 */
  }
}

@media (max-width: 480px) {

  /* 小屏手机设备：超小屏幕尺寸 */
  .slogan {
    padding: 40px 4%;
    /* 最小内边距 */
  }

  .slogan .slogan-en {
    font-size: clamp(0.9rem, 4.5vw, 1.5rem);
    /* 超小屏幕下的英文字体大小 */
    margin-bottom: 15px;
    /* 进一步调整间距 */
  }

  .slogan .slogan-cn {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    /* 超小屏幕下的中文字体大小 */
  }
}

/* 动效加载器区域 */
.loader-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  /* 调小padding减少与slogan的距离 */
  margin-bottom: 1px;
  /* 控制动效区域与footer的下边距 */
  min-height: 350px;
  /* 控制整个动效区域最小高度 */
  position: relative;
  overflow: visible;
}

/* From Uiverse.io by AatreyuShau */
.loader-section svg {
  width: 100%;
  max-width: 400px;
  max-height: 400px;
  height: auto;
  overflow: visible;
  display: block;
  margin: 0 auto;
}

.segment {
  stroke: rgba(0, 0, 0, 0);
  stroke-width: 10;
  stroke-linecap: round;
}

.joint {
  fill: rgb(0, 0, 0);
  stroke-width: 5px;
}

#mir {
  scale: -0.25;
}

/* Animate first arm segment rotation */
.arm {
  filter: url("#metaball");
  scale: 0.25;
  transform-origin: 250px 250px;
  animation: rotate 31s ease-in-out infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(-90deg);
  }

  25% {
    transform: rotate(360deg);
  }

  50% {
    transform: rotate(90deg);
  }

  75% {
    transform: rotate(-360deg);
  }

  100% {
    transform: rotate(-90deg);
  }
}

/* Animate second arm segment relative to elbow */
.arm1 {
  transform-origin: 300px 200px;
  animation: rotate 23s ease-in-out infinite;
}

.arm2 {
  transform-origin: 400px 200px;
  animation: rotate 17s ease-in-out infinite;
}

.arm3 {
  transform-origin: 490px 200px;
  animation: rotate 11s ease-in-out infinite;
}

/* 底部区域 */
footer {
  text-align: center;
  padding: 20px 10%;
  background-color: #fff;
  border-top: 1px solid #eee;
}

footer p {
  font-size: 14px;
  color: #999;
}

.sub-slogan {
  font-size: 12px;
  color: #aaa;
  margin-top: 8px;
}

:root {
  --reveal-distance: 32px;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-distance), 0);
  will-change: transform, opacity;
}

.reveal-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 600ms ease-out;
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal-visible {
    transition: none;
    transform: none;
    opacity: 1;
  }
}

/* All Works 页面特定样式 */
.all-works-container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 60px 40px 120px 40px;
}

.all-works-title {
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 60px;
    text-align: center;
}

.all-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.all-works-grid .tile {
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #f4f4f4;
}

.all-works-grid .tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.all-works-grid .tile:hover img {
    transform: scale(1.05);
}

/* 返回按钮样式 */
.back-button {
    position: fixed;
    left: calc((100vw - 1600px) / 2 - 60px);
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(231, 231, 231, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.4;
    z-index: 999;
    transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

.back-button:hover {
    opacity: 1;
    background-color: rgba(211, 223, 231, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.back-button svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: #696969;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media screen and (max-width: 1700px) {
    .back-button {
        left: 20px;
    }
}

@media screen and (max-width: 768px) {
    .back-button {
        display: none;
    }

    .all-works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .all-works-container {
        padding: 40px 20px 80px 20px;
    }

    .all-works-title {
        font-size: 24px;
        margin-bottom: 40px;
    }
}

@media screen and (max-width: 480px) {
    .all-works-grid {
        grid-template-columns: 1fr;
    }
}
