/* ==========================================================================
   Leon — Personal Website
   严格还原 Figma 设计稿：字体 PingFang SC · 设计稿配色 · 设计稿布局
   ========================================================================== */

:root {
  /* 始终使用浅色模式，避免 Safari 底部地址栏在深色背景区自动切换为深色 */
  color-scheme: light;

  /* 设计稿配色 */
  --color-white: #ffffff;
  --color-dark: #1d1d1f;        /* Dark Theme */
  --color-grey: #6e6e73;        /* Grey */
  --color-light-grey: #9a9aa4;  /* Light Grey */
  --color-bg: #f5f5f7;          /* 画布背景 */
  --color-card-grey: #eeeef2;   /* 卡片浅灰 */
  --color-placeholder: #d9d9d9;
  --color-border: #e0e0e0;

  --nav-height: 80px;

  /* 字体 */
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;

  /* 圆角（设计稿） */
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;

  /* 阴影（设计稿） */
  --shadow-card: 0 0 12px 0 rgba(0, 0, 0, 0.1);

  /* 各端左右留白（container padding 同值）：Works 全宽滚动对齐用 */
  --gutter: 24px;

  /* 动效 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 去除移动端点击时浏览器默认的高亮（tap highlight），
     避免 phone 端点击标签等元素出现短暂的选中加深 */
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* iOS Safari 上 body 单独 overflow-x:hidden 无法阻止横向滚动，
     需在 html 上也裁剪，形成双重兜底 */
  overflow-x: hidden;
}

body {
  font-family: var(--font-stack);
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* 全站隐藏文本插入光标（caret）：本页无输入框，任何焦点残留
     导致的光标竖线闪烁都应被彻底消除 */
  caret-color: transparent;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  /* 禁止选中按钮文字：避免点击/双击按钮时出现闪烁的文本插入光标 */
  user-select: none;
  -webkit-user-select: none;
}

img {
  display: block;
  max-width: 100%;
}

/* hidden 属性强制隐藏（避免被组件自身的 display 规则覆盖） */
[hidden] {
  display: none !important;
}

/* 可见焦点环：仅在键盘导航时显示，鼠标点击不显示（避免“输入光标闪烁”）。
   body 上无 .is-keyboard 类时，所有 :focus-visible 的 outline 隐藏；
   用户按下 Tab 键后 JS 会给 body 添加 .is-keyboard，此时才显示焦点环。 */
body:not(.is-keyboard) :focus-visible {
  outline: none;
}

body.is-keyboard :focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

/* ==========================================================================
   顶部导航栏（毛玻璃，随滚动切换深浅色）
   ========================================================================== */
.nav {
  --nav-fg: var(--color-white);
  --nav-cta-bg: rgba(255, 255, 255, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  /* 导航栏整体禁止选中文字：避免点击菜单空白处出现文本插入光标 */
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.4s var(--ease-soft),
    box-shadow 0.4s var(--ease-soft);
}

/* 滚动到浅色板块：深色文字 + 白色毛玻璃 */
.nav.is-dark {
  --nav-fg: var(--color-dark);
  --nav-cta-bg: rgba(0, 0, 0, 0.06);
  background-color: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.nav-inner {
  position: relative;
  max-width: 1920px;
  height: 100%;
  margin: 0 auto;
}

/* 语言切换（左） */
.nav-lang {
  position: absolute;
  left: 160px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--nav-fg);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s var(--ease-soft), opacity 0.3s var(--ease-soft),
    transform 0.3s var(--ease-soft);
}

.nav-lang:hover {
  opacity: 0.7;
  transform: translateY(-50%) scale(1.05);
}

/* 主导航（中） */
.nav-menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-link {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--nav-fg);
  padding: 8px 0;
  opacity: 0.85;
  transition: color 0.3s var(--ease-soft), opacity 0.3s var(--ease-soft);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--nav-fg);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.3s var(--ease-soft);
}

.nav-link:hover,
.nav-link.is-active {
  opacity: 1;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

/* Contact me（右） */
.nav-cta {
  position: absolute;
  right: 160px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--nav-fg);
  background: var(--nav-cta-bg);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  transition: background-color 0.35s var(--ease-soft),
    transform 0.35s var(--ease-soft), color 0.3s var(--ease-soft);
}

.nav-cta:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.04);
}

.nav.is-dark .nav-cta:hover {
  background: rgba(0, 0, 0, 0.1);
}

.nav-cta:active {
  transform: translateY(-50%) scale(0.98);
}

/* 移动端菜单里的 Contact me（桌面端隐藏，右侧用 .nav-cta 按钮） */
.nav-menu-cta {
  display: none;
}

/* 移动端汉堡 */
.nav-burger {
  display: none;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 300;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--nav-fg);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-soft), background-color 0.3s;
}

.nav-burger.is-open span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-burger.is-open span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

/* ==========================================================================
   通用 Section
   ========================================================================== */
.section {
  position: relative;
  padding: 140px 0;
}

.container {
  max-width: 1488px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-head {
  margin-bottom: 56px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  margin-bottom: 16px;
}

.section-sub {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-dark);
}

/* ==========================================================================
   ① Home / Hero
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 720px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("../assets/images/hero-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 轻微暗角保证白字可读 */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.08) 40%,
    rgba(0, 0, 0, 0.08) 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  transform: translateY(-6.5%);
}

.hero-title {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.9s var(--ease-out) 0.15s forwards;
}

.hero-subtitle {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  color: var(--color-white);
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.9s var(--ease-out) 0.35s forwards;
}

/* ==========================================================================
   ② Featured Projects
   ========================================================================== */
.projects {
  background: var(--color-bg);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  height: 520px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transform: translateZ(0);
}

/* 图片放大层（经典 zoom-in：卡片容器不动，仅图片放大）
   注意：不设 will-change:transform，否则在 iOS Safari 上图片被提升为
   独立合成层，导致父容器 border-radius + overflow:hidden 的圆角裁剪失效 */
.card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s var(--ease-out), opacity 0.5s var(--ease-out);
  z-index: 0;
  /* 默认隐藏：图片完全加载出来之前整张图不显示，避免从上到下渐进解码，
     加载完成后加 .is-loaded 再一次性淡入 */
  opacity: 0;
  background: var(--color-card-grey);
}

/* 图片加载完成：整张图一次性淡入 */
.work-card.is-loaded .card-media,
.project-card.is-loaded .card-media {
  opacity: 1;
}

/* 图片未加载完成时隐藏标题/副标题，避免左上角闪现文字 */
.work-card:not(.is-loaded) .card-overlay,
.project-card:not(.is-loaded) .card-overlay {
  opacity: 0;
}

.card-overlay {
  transition: opacity 0.4s var(--ease-out);
}

/* 中心 loading 圈（参考 Apple 加载动画：浅灰底 + 细圆环旋转） */
.work-card:not(.is-loaded)::after,
.project-card:not(.is-loaded)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  animation: card-spinner 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes card-spinner {
  to {
    transform: rotate(360deg);
  }
}

.project-card:hover .card-media {
  transform: scale(1.06);
}

.card-overlay {
  position: absolute;
  left: 32px;
  top: 32px;
  right: 32px;
  z-index: 2;
  /* 提升为独立合成层：iPad Safari 左右切换横向平移时，
     避免图片重绘导致标题/副标题文字短暂消失 */
  transform: translateZ(0);
}

.card-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
}

.card-desc {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-dark);
  margin-top: 12px;
}

/* 深色背景卡片用白字 */
.project-card-light .card-title,
.project-card-light .card-desc,
.work-card-light .card-title,
.work-card-light .card-desc {
  color: var(--color-white);
}

/* 无图占位卡片 */
.project-card-placeholder {
  background: var(--color-card-grey);
  transition: transform 0.4s var(--ease-out);
}

.project-card-placeholder:hover {
  transform: scale(1.02);
}

/* 额外卡片默认隐藏，Show more 后展开 */
.project-card.is-extra {
  display: none;
}

.projects-grid.is-expanded .project-card.is-extra {
  display: block;
}

/* Show more（居中） */
.section-more {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  transition: background-color 0.35s var(--ease-soft),
    transform 0.35s var(--ease-soft);
}

.btn-more:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: scale(1.04);
}

/* ==========================================================================
   ③ Personal Works
   ========================================================================== */
.works {
  background: var(--color-white);
  /* 裁剪 works-viewport 向右溢出的部分：其 margin-right 用 50vw 计算，
     而 vw 含滚动条宽度（Windows 约 15px），会把文档横向撑宽、导致
     右侧露出画布灰底、白底看起来没铺满 */
  overflow-x: clip;
}

/* 分类筛选（居中） */
.works-category {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 6px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  width: fit-content;
  margin: 0 auto 48px;
}

/* 滑动指示滑块（绝对定位，在按钮背后平滑移动） */
.chip-slider {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 0;
  background: var(--color-dark);
  border-radius: var(--radius-md);
  transition: transform 0.35s var(--ease-soft), width 0.35s var(--ease-soft);
  z-index: 0;
}

.works-category .chip,
.experience-category .chip {
  position: relative;
  z-index: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  border-radius: var(--radius-md);
  transition: background-color 0.3s var(--ease-soft),
    color 0.3s var(--ease-soft);
  /* 点击分类按钮时不出现文本选择光标 / iOS 点击高亮 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chip.is-active {
  background: var(--color-dark);
  color: var(--color-white);
}

.chip:not(.is-active):hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Works / Experience 分类：由滑块承担背景，chip 自身不显示背景色 */
.works-category .chip.is-active,
.experience-category .chip.is-active {
  background: transparent;
  color: var(--color-white);
}

.works-category .chip:not(.is-active):hover,
.experience-category .chip:not(.is-active):hover {
  background: transparent;
}

.works-viewport {
  position: relative;
  z-index: 1;
  overflow: hidden;
  /* 左右铺满视口，让卡片切换时可进入两侧留白。
     50vw 含滚动条宽度，而标题所在的 container 相对不含滚动条的内容区定位，
     两者相差半个滚动条（--sbw/2），需补偿回来，否则首卡比标题偏左 */
  margin-left: calc(50% - 50vw + var(--sbw, 0px) / 2);
  margin-right: calc(50% - 50vw + var(--sbw, 0px) / 2);
  padding: 16px 0;
}

.works-track {
  display: flex;
  gap: 24px;
  /* 左右内边距 = 各端留白（--gutter）：首卡对齐标题、尽头对齐对称留白 */
  padding: 0 var(--gutter);
  transition: transform 0.5s var(--ease-out);
}

.work-card {
  position: relative;
  flex: 0 0 400px;
  width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  height: 440px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transform: translateZ(0);
}

.work-card:hover .card-media {
  transform: scale(1.06);
}

.work-card.is-hidden {
  display: none;
}

/* 无图占位卡片 */
.work-card-placeholder {
  background: var(--color-card-grey);
  transition: transform 0.4s var(--ease-out);
}

.work-card-placeholder:hover {
  transform: scale(1.02);
}

/* 左右箭头 */
.works-arrows {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  justify-content: flex-end;
}

.arrow-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #f2f2f2;
  color: var(--color-dark);
  transition: background-color 0.3s var(--ease-soft),
    transform 0.3s var(--ease-soft);
}

.arrow-btn.is-active {
  background: var(--color-border);
}

.arrow-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.arrow-btn:disabled:hover {
  transform: none;
}

.arrow-btn svg {
  width: 20px;
  height: 20px;
}

.arrow-btn:hover {
  transform: scale(1.1);
}

/* ==========================================================================
   ④ Experience / About
   ========================================================================== */
.experience {
  background: var(--color-white);
}

.experience-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 64px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
}

.experience-portrait {
  width: 320px;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.experience-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.experience-title {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  margin-bottom: 16px;
}

.experience-sub {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-grey);
  margin-bottom: 52px;
  /* 一行展示：强制不换行，确保 1920×1080 下整句副标题在一行内 */
  white-space: nowrap;
}

.experience-category {
  position: relative;
  display: flex;
  padding: 6px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  width: fit-content;
  margin-bottom: 48px;
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.position {
  display: flex;
  gap: 24px;
}

.position-logo {
  display: block;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  object-fit: cover;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
  /* 点击图标时不出现文本选择光标 / iOS 点击高亮 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
}

/* 无 logo 的机构占位 */
.position-logo-placeholder {
  background: var(--color-placeholder);
}

.position-body {
  flex: 1;
}

.position-org {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.position-items {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.position-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.position-role {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  margin-top: 8px;
}

.position-year {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  color: var(--color-light-grey);
}

.position-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-light-grey);
}

.position-empty {
  font-size: 20px;
  color: var(--color-light-grey);
  padding: 32px 0;
}

/* ==========================================================================
   ⑤ Ability
   ========================================================================== */
.ability {
  background: var(--color-bg);
  padding: 96px 0;
}

.ability-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  margin-bottom: 32px;
}

.ability-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 64px;
  align-items: center;
}

.ability-roles {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.role-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--color-card-grey);
  border-radius: var(--radius-lg);
  padding: 10px 24px;
  text-align: left;
  width: fit-content;
  max-width: 100%;
  height: 56px;
  overflow: hidden;
  cursor: pointer;
  transition: width 0.7s cubic-bezier(0.34, 1.2, 0.64, 1),
    height 0.7s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.role-item.is-open {
  width: 100%;
  height: 170px;
  /* 展开态：标题回到卡片顶部，与下方详情留出间距 */
  justify-content: flex-start;
  padding-top: 20px;
}

.role-head {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 36px;
  width: 100%;
}

.role-name {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-dark);
  white-space: nowrap;
  opacity: 1;
}

.role-arrow {
  margin-left: auto;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.role-arrow svg {
  width: 20px;
  height: 20px;
}

.role-item.is-open .role-arrow {
  transform: rotate(180deg);
  transition: transform 0.7s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.role-detail {
  position: absolute;
  top: 64px;
  left: 24px;
  right: 24px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-light-grey);
  opacity: 0;
  /* 折叠态：立即淡出（0.2s），让内容先隐藏、卡片再折叠 */
  transition: opacity 0.2s ease 0s;
  pointer-events: none;
}

.role-item.is-open .role-detail {
  opacity: 1;
  /* 展开态：卡片先展开（height 0.7s），内容延迟 0.35s 再淡入 */
  transition: opacity 0.35s ease 0.35s;
}

.ability-picture {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 560px;
  align-self: center;
  background: var(--color-card-grey);
}

/* 两层图片叠放：切换角色时新图在上层淡入，避免换图瞬间闪白。
   层状态（opacity / z-index）由 JS 内联控制，这里只定义过渡 */
.ability-picture img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .ability-picture img {
    transition: none;
  }
}

/* ==========================================================================
   ⑥ Contact（2 行 3 列）
   ========================================================================== */
.contact {
  position: relative;
  overflow: hidden;
  padding: 140px 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.contact-bg {
  position: absolute;
  inset: -40px;
  background-image: url("../assets/images/contact-bg.png");
  background-size: cover;
  background-position: center;
  filter: brightness(0.7) blur(30px);
  transform: scale(1.1);
}

.contact-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 72px 104px;
  max-width: 960px;
  margin: 0 auto;
}

.contact-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-white);
}

/* 微信/QQ 项：宽度随内容自适应，浮窗居中于内容 */
.contact-item.qr-item {
  width: fit-content;
  justify-self: start;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}

.contact-icon svg {
  width: 24px;
  height: 24px;
}

.contact-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
}

/* QQ / 微信二维码浮窗（hover 显示） */
.contact-qr {
  position: absolute;
  bottom: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 160px;
  height: 184px;
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft),
    visibility 0.3s;
  z-index: 10;
}

/* 微信浮窗（contact-float-WeChat.svg，33×33 二维码） */
.contact-qr-wechat {
  background-image: url('../assets/images/contact-float-WeChat.svg');
}

/* QQ 浮窗（contact-float-QQ.svg，29×29 二维码） */
.contact-qr-qq {
  background-image: url('../assets/images/contact-float-QQ.svg');
}

.contact-item:hover .contact-qr,
.contact-item:focus-within .contact-qr {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.contact-qr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.contact-qr-head .contact-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--color-dark);
}

.contact-qr-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
}

.contact-qr-code {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
}

/* QQ 二维码（第二行）向下弹出，避免遮挡第一行的微信 */
.contact-qr-down {
  bottom: auto;
  top: calc(100% + 16px);
  transform: translateX(-50%) translateY(-8px);
}

.contact-item:hover .contact-qr-down,
.contact-item:focus-within .contact-qr-down {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   ⑦ 作品详情弹窗（StarPet Cottage）
   严格还原 Figma 设计稿（content-StarPet Cottage-English/Chinese）
   画板 1260×3180 · 圆角 32 · 白底 · 左右内边距 80
   布局自上而下：hero 图 → 标题 → Tags(左)+副标题(右) → 名片图
   → 描述 → 海报图 → 描述 → close(底部居中)

   交互模式：全屏覆盖的「详情页式」弹窗 —— 整个弹窗容器自身滚动，
   浮窗随滚动整体移出视口（不锁定自身高度），关闭按钮 sticky 固定在视口底部。
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  /* 弹窗容器自身滚动，浮窗随滚动整体移出屏幕 */
  overflow-y: auto;
  overflow-x: hidden;
  /* 滚动到底/顶后，阻止滚动链穿透到背景页面 */
  overscroll-behavior: contain;
  /* 隐藏滚动条但保留滚动能力 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-soft), visibility 0.3s;
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  /* 遮罩固定铺满视口，不随内容滚动；
     pointer-events: none 让滚轮事件穿透到 .modal，浮窗外滚动仍作用于详情 */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  /* 随弹窗一起渐显，避免模糊过渡生硬 */
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft);
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1260px;
  /* 居中并留出上下呼吸空间，随内容自然伸展 */
  margin: 40px auto;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  transform: translateY(24px) scale(0.98);
  transition: transform 0.6s var(--ease-out);
}

.modal.is-open .modal-panel {
  transform: translateY(0) scale(1);
}

/* 内容区：内边距严格对照设计稿（左右 80、顶部 80）。
   底部留白仅需让最后一段不被 fixed 关闭按钮遮挡即可 */
.modal-scroll {
  padding: 80px 80px 96px;
}

/* 图片容器（默认 1100×640，具体比例由内联 style 按各 frame 尺寸设置） */
.modal-figure {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  background: var(--color-light-grey);
  overflow: hidden;
  /* 与设计稿一致：默认图片容器 1100×640，特殊 frame 用内联 style 覆盖 */
  aspect-ratio: 1100 / 640;
}

.modal-figure img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  /* 图片自身也按圆角裁切，避免圆角边缘抗锯齿时混入容器浅灰背景，
     在纯白底图片（如 Vanvi）上产生一圈细灰线 */
  border-radius: inherit;
  /* 默认隐藏：图片完全加载出来之前整张图不显示，避免从上到下渐进解码，
     加载完成后加 .is-loaded 再一次性淡入（与卡片图片一致的 loading 交互） */
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.modal-figure.is-loaded img {
  opacity: 1;
}

/* 图片加载完成后，去掉容器的浅灰占位背景、改回与弹窗一致的白色。
   关键：圆角裁切后露出的四角是「容器背景」，之前一直是浅灰 #9a9aa4，
   即使给 img 加了 border-radius 也盖不住这层底，纯白底图片圆角处仍会
   现出一圈细灰线。加载完变白后四角与弹窗白底融合，灰线彻底消失。 */
.modal-figure.is-loaded {
  background: var(--color-white);
}

/* 图片未加载完成时显示中心 loading 圈（与卡片一致） */
.modal-figure:not(.is-loaded)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  animation: card-spinner 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

/* 标题（顶部，无上边距） */
.modal-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 48px;
  color: var(--color-dark);
  margin-top: 0;
}

/* Tags(左) + 副标题(右) 并排
   设计稿：Tags 左边缘 x=80，副标题左边缘 x=380（距内容区左缘 300px），
   Tags 列宽约 170px，故 gap ≈ 130px */
.modal-meta {
  display: flex;
  align-items: flex-start;
  gap: 130px;
  margin-top: 24px;
}

/* Tags：纵向排列，每组 label 在上、value 在下，组间 32px */
.modal-tags {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 0 0 auto;
  min-width: 220px;
}

.modal-tag {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-tag-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 16px;
  color: var(--color-light-grey);
}

.modal-tag-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 24px;
  color: var(--color-dark);
}

/* 副标题：24px/40px 正文，宽 800，段落间距 24px */
.modal-intro {
  flex: 1;
  max-width: 800px;
}

/* 介绍右对齐（如 Cat in the Woods 的诗句） */
.modal-intro--right {
  text-align: right;
}

.modal-intro p {
  font-size: 24px;
  font-weight: 400;
  line-height: 40px;
  color: var(--color-dark);
  /* 保留换行（如 Cat in the Woods 的诗句） */
  white-space: pre-line;
}

.modal-intro p + p {
  margin-top: 24px;
}

/* 描述段落：24px/40px */
.modal-para {
  font-size: 24px;
  font-weight: 400;
  line-height: 40px;
  color: var(--color-dark);
  white-space: pre-line;
}

/* 通用间距规则：用相邻兄弟选择器统一管理，适配不同作品
   （图片数量 / 尺寸 / 段落数不同）的详情结构 */
.modal-title + .modal-figure { margin-top: 48px; }   /* 标题 → 第一张图 */
.modal-meta + .modal-figure { margin-top: 48px; }    /* 标签+介绍 → 图 */
.modal-figure + .modal-figure { margin-top: 48px; }  /* 图 → 图 */
.modal-figure + .modal-para { margin-top: 24px; }    /* 图 → 描述 */
.modal-para + .modal-figure { margin-top: 36px; }    /* 描述 → 图 */
.modal-para + .modal-para { margin-top: 24px; }      /* 描述 → 描述 */

/* 左右分布布局（Cat in the Woods：左列文字 + 右列 640×640 图片）
   设计稿：内容区 1100 = 左列 440（tags 在上、诗句在下）+ 间距 20 + 图片 640 */
.modal-split {
  display: flex;
  align-items: flex-start;
  gap: var(--split-gap, 20px);
  margin-top: 48px;
}

.modal-split-text {
  flex: 0 0 var(--split-text-width, 440px);
  max-width: var(--split-text-width, 440px);
  display: flex;
  flex-direction: column;
}

/* split 左列里 meta 改为上下堆叠（tags 在上，intro 在下），间距 48 */
.modal-split-text .modal-meta {
  flex-direction: column;
  align-items: flex-start;
  gap: 48px;
  margin-top: 0;
}

.modal-split-text .modal-tags {
  min-width: 0;
}

.modal-split-text .modal-intro {
  max-width: none;
}

.modal-split-figure {
  flex: 1;
  min-width: 0;
}

.modal-split-figure .modal-figure {
  width: 100%;
}

/* 左右分布区域之后接全宽图（如 WuYa 首图后的 WuYa-02） */
.modal-split + .modal-figure {
  margin-top: 48px;
}

/* ⑧ close 按钮：fixed 固定在视口底部（不随内容滚出屏幕）
   位于 .modal 直接子级，脱离内容流，始终吸附在视口下方。 */
.modal-close-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding-bottom: 80px;
  /* 顶部轻微渐隐，让按钮在内容滚动时更清晰 */
  pointer-events: none;
}

.modal-close {
  position: relative;
  pointer-events: auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  /* 毛玻璃效果：半透明黑色背景 + 背景模糊 */
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  color: #ffffff;
  transition: background-color 0.3s var(--ease-soft), transform 0.3s var(--ease-soft);
}

/* 扩大可点击热区：视觉 48px 之外再外扩一圈透明的命中区域 */
.modal-close::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.08);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   动画关键帧
   ========================================================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动渐入 */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (min-width: 1601px) {
  .nav-lang {
    left: 160px;
  }
  .nav-cta {
    right: 160px;
  }
}

@media (max-width: 1600px) {
  .nav-lang {
    left: 96px;
  }
  .nav-cta {
    right: 96px;
  }
}

@media (max-width: 1280px) {
  /* 收窄导航菜单，避免 About 与右侧 Contact me 按钮重叠；
     居中紧凑布局（不用 space-between 分散），避免按钮间距过大 */
  .nav-menu {
    width: 480px;
    justify-content: center;
    gap: 40px;
  }

  /* 横屏（如 iPad Air 3 横屏 1112px）加大左右留白 */
  .container {
    padding: 0 40px;
  }
  :root {
    --gutter: 40px;
  }

  /* Featured Projects：iPad 横屏卡片高度（520 → 320） */
  .project-card {
    height: 320px;
  }

  /* Personal Works：横屏压缩垂直节奏，让卡片与左右切换尽量一屏展示；
     标题与固定导航栏保持舒适间距，通过缩小卡片腾出空间 */
  .works {
    padding-top: 120px;
    padding-bottom: 80px;
  }
  .work-card {
    flex: 0 0 300px;
    width: 300px;
    height: 340px;
  }
  .works .section-head {
    margin-bottom: 24px;
  }
  .works .section-title {
    margin-bottom: 8px;
  }
  .works-category {
    margin-bottom: 16px;
  }
  .works-arrows {
    margin-top: 24px;
  }

  /* Ability：iPad 横屏改为左（职位名称）右（图片）结构 */
  .ability-card {
    grid-template-columns: 400px 1fr;
    gap: 48px;
  }

  .ability-picture {
    height: 480px;
  }

  /* iPad 横屏整体字号缩小 2px（1112px 命中此断点；
     下方 1024px/768px 断点会对部分字号再作覆盖） */
  .nav-lang { font-size: 20px; }
  .nav-link { font-size: 18px; }
  .nav-cta { font-size: 18px; }
  .section-title { font-size: 30px; }
  .section-sub { font-size: 18px; }
  .hero-title { font-size: 62px; }
  .hero-subtitle { font-size: 30px; }
  .card-title { font-size: 28px; }
  .card-desc { font-size: 16px; }

  /* iPad 横屏卡片标题/副标题更靠左上角 */
  .card-overlay {
    left: 20px;
    top: 20px;
    right: 20px;
  }
  .card-desc {
    margin-top: 8px;
  }
  .btn-more { font-size: 18px; }
  .chip { font-size: 18px; }
  .experience-title { font-size: 62px; }
  /* iPad 横屏内容区较窄（约 648px），副标题一行放不下会横向溢出，
     改为自动换行并放宽行距 */
  .experience-sub {
    font-size: 18px;
    white-space: normal;
    line-height: 1.4;
  }
  .position-org { font-size: 16px; }
  /* 长职位名（Projects/Awards 下标题较长）在窄内容区换行时，
     放宽行距避免两行文字上下重叠 */
  .position-role { font-size: 22px; line-height: 1.3; }
  .position-year { font-size: 16px; }
  .position-desc { font-size: 16px; }
  .position-empty { font-size: 18px; }
  .ability-title { font-size: 30px; }
  .role-name { font-size: 22px; }
  .role-detail { font-size: 16px; }
  .contact-text { font-size: 16px; }
  .contact-qr-num { font-size: 16px; }

  /* 作品详情弹窗：iPad 横屏缩小标题与内边距 */
  .modal-scroll { padding: 48px 48px 96px; }
  .modal-title { font-size: 40px; line-height: 40px; }
  .modal-intro p,
  .modal-para { font-size: 20px; line-height: 34px; }
  .modal-tag-value { font-size: 20px; }
  .modal-meta { gap: 100px; }
}

@media (max-width: 1024px) {
  :root {
    --nav-height: 96px;
  }

  .nav-lang {
    left: 48px;
    font-size: 20px;
  }

  .nav-menu {
    left: 140px;
    right: 240px;
    transform: translateY(-50%);
    width: auto;
    justify-content: center;
    gap: 40px;
  }

  .nav-link {
    font-size: 18px;
  }

  .nav-cta {
    right: 48px;
    padding: 16px 26px;
    font-size: 18px;
    border-radius: 28px;
  }

  .hero-title {
    font-size: 46px;
  }

  .hero-subtitle {
    font-size: 26px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .project-card {
    height: 440px;
  }

  .experience-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .experience-portrait {
    width: 240px;
    height: 300px;
  }

  /* Ability：竖屏改回上下结构（图片在上、职位在下） */
  .ability-card {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .ability-picture {
    order: -1;
    height: 420px;
  }

  /* 平板端加大左右留白，避免内容贴边 */
  .container {
    padding: 0 56px;
  }
  :root {
    --gutter: 56px;
  }

  /* Personal Works：竖屏标题不被 96px 导航栏挡住，卡片恢复常规高度 */
  .works {
    padding-top: 140px;
  }
  .work-card {
    height: 330px;
  }

  /* Contact：竖屏改为 2 列，时间/位置并排一行，文字不换行 */
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 40px 48px;
  }
  .contact-text {
    white-space: nowrap;
  }

  /* 竖屏下微信浮窗改为向下弹出，与 QQ 一致，避免遮挡上方内容 */
  .contact-qr-wechat {
    bottom: auto;
    top: calc(100% + 16px);
    transform: translateX(-50%) translateY(-8px);
  }
  .contact-item:hover .contact-qr-wechat,
  .contact-item:focus-within .contact-qr-wechat {
    transform: translateX(-50%) translateY(0);
  }

  /* 作品详情弹窗：竖屏适配（Tags 与副标题保持左右分布，与 web 一致） */
  .modal-scroll { padding: 40px 40px 96px; }
  .modal-title { font-size: 32px; line-height: 32px; }
  .modal-intro p,
  .modal-para { font-size: 18px; line-height: 30px; }
  .modal-tag-value { font-size: 18px; }
  .modal-meta {
    flex-direction: row;
    gap: 48px;
  }
  .modal-tags {
    flex-direction: column;
    gap: 32px;
  }
  /* 竖屏平板：split 降级为上下堆叠后，文字区内的 tags 与 intro 恢复左右并排 */
  .modal-split-text .modal-meta {
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
  }
  .modal-split-text .modal-tags {
    min-width: 220px;
  }
  /* 左右分布布局：平板/竖屏降级为上下堆叠 */
  .modal-split {
    flex-direction: column;
    gap: 24px;
  }
  /* 手机端顺序：标题 → 图片 → 标签 → 介绍（图片排最前，文字列在后） */
  .modal-split-text {
    flex: none;
    width: 100%;
    max-width: none;
    order: 2;
  }
  .modal-split-figure {
    width: 100%;
    order: 1;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 54px;
  }

  /* 手机端左右留白 24px（覆盖 ≤1024 的 56px） */
  .container {
    padding: 0 24px;
  }
  :root {
    --gutter: 24px;
  }

  .section {
    padding: 88px 0;
  }

  .nav-lang {
    left: 20px;
    font-size: 16px;
    z-index: 300;
  }

  .nav-menu,
  .nav-cta {
    display: none;
  }

  .nav-burger {
    display: flex;
  }

  /* 移动端全屏菜单 */
  .nav.is-open .nav-lang {
    color: #fff;
  }

  .nav.is-open .nav-burger span {
    background: #fff;
  }

  .nav.is-open .nav-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    transform: none;
    gap: 36px;
    background: rgba(0, 0, 0, 0.88);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    z-index: 250;
  }

  .nav.is-open .nav-link {
    font-size: 22px;
    color: #fff;
    opacity: 1;
  }

  .nav.is-open .nav-link::after {
    background: #fff;
  }

  .nav.is-open .nav-menu-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
  }

  .hero {
    min-height: 560px;
  }

  .hero-title {
    font-size: 30px;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .section-title,
  .ability-title {
    font-size: 24px;
  }

  .section-sub {
    font-size: 16px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .project-card {
    height: 400px;
  }

  .work-card {
    flex: 0 0 240px;
    width: 240px;
    height: 280px;
  }

  .experience-title {
    font-size: 28px;
  }

  .experience-sub {
    font-size: 16px;
    /* 移动端恢复自动换行，避免一行放不下导致横向溢出 */
    white-space: normal;
    margin-bottom: 40px;
  }

  /* 手机端：Experience 改为左右布局（图片靠左，标题靠右上、副标题靠右下，tabs/列表通栏在下） */
  .experience-layout {
    display: block;
  }

  .experience-portrait {
    float: left;
    margin: 0 16px 24px 0;
    width: 132px;
    height: 165px;
    border-radius: 24px;
  }

  .experience-category,
  .experience-list {
    clear: both;
  }

  .experience-category {
    margin-bottom: 40px;
  }

  .position-role {
    font-size: 18px;
  }

  /* 卡片文字 */
  .card-title {
    font-size: 22px;
  }

  .card-desc {
    font-size: 16px;
  }

  /* 分类标签 / Show more 按钮 */
  .chip {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    padding: 10px 6px;
    white-space: nowrap;
  }

  .btn-more {
    font-size: 16px;
    padding: 14px 22px;
  }

  /* 经历详情 */
  .position-org {
    font-size: 14px;
  }

  .position-year {
    font-size: 14px;
  }

  .position-desc {
    font-size: 14px;
  }

  /* 联系信息：内容区靠上（不垂直居中），上留白 144px */
  .contact {
    padding-top: 144px;
    align-items: flex-start;
  }

  .contact-text {
    font-size: 14px;
  }

  /* 语言切换 */
  .nav-lang {
    font-size: 16px;
  }

  .ability-card {
    padding: 24px;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ability-picture {
    height: 200px;
  }

  .contact-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin: 0 auto;
    gap: 38px;
  }

  .works-category,
  .experience-category {
    width: 100%;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .contact-qr {
    bottom: auto;
    top: calc(100% + 12px);
    transform: translateX(-50%) translateY(-8px);
  }

  .contact-item:hover .contact-qr,
  .contact-item:focus-within .contact-qr {
    transform: translateX(-50%) translateY(0);
  }

  /* 手机端恢复被 1280px 断点缩小前的字号（仅 iPad 需要缩 2px） */
  .role-name { font-size: 18px; } /* 职业名称标题：18px */
  .role-detail { font-size: 14px; } /* 简介内容：小 2px */
  .position-empty { font-size: 20px; }
  .contact-qr-num { font-size: 16px; }

  /* 手机端：Ability 方框高度 48px、左右留白 22px */
  .role-item {
    height: 48px;
    padding: 10px 22px;
  }
  .role-item.is-open {
    height: 168px;
    padding-top: 18px;
  }

  /* 手机端：方框之间间距缩短 */
  .ability-roles {
    gap: 12px;
  }

  /* 作品详情弹窗：手机端保留浮窗感（四周留边距、保留圆角），内边距与字号压缩 */
  .modal-panel {
    max-width: calc(100% - 24px);
    margin: 12px auto;
    border-radius: 20px;
  }
  .modal-scroll {
    padding: 28px 24px 96px;
  }
  .modal-title {
    font-size: 28px;
    line-height: 28px;
    margin-top: 0;
  }
  .modal-meta {
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
  }
  /* 手机端：split 文字区内 tags 与 intro 恢复上下堆叠（标题→图片→标签→介绍） */
  .modal-split-text .modal-meta {
    flex-direction: column;
    gap: 24px;
  }
  .modal-split-text .modal-tags {
    min-width: 0;
  }
  /* 手机端：Tags 四个组竖向排列（Service→Time→Team→Location），
     label 字号减小、value 字号不变 */
  .modal-tags {
    flex-direction: column;
    gap: 20px;
  }
  .modal-tag-label {
    font-size: 12px;
    line-height: 12px;
  }
  /* 手机端：图片容器圆角减小一半（24px → 12px） */
  .modal-figure {
    border-radius: 12px;
  }
  .modal-intro p,
  .modal-para {
    font-size: 16px;
    line-height: 26px;
  }
  /* 手机端：收紧详情间距 */
  .modal-title + .modal-figure,
  .modal-meta + .modal-figure,
  .modal-figure + .modal-figure { margin-top: 24px; }
  .modal-figure + .modal-para,
  .modal-para + .modal-figure,
  .modal-para + .modal-para { margin-top: 20px; }
  .modal-close-wrap {
    margin-top: 32px;
    padding-bottom: 48px;
  }
  .modal-tag-value {
    font-size: 16px;
  }
}

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
