* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   自托管字体 · Self-hosted & Subset
   Inter (拉丁) 28.9 KB  ·  Noto Sans SC 300/400/500 约 44 KB 每个
   按页面实际用字切片，零外部请求，跨设备渲染完全一致
   ============================================================ */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('fonts/inter-vf.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/noto-sans-sc-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/noto-sans-sc-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Sans SC';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/noto-sans-sc-500.woff2') format('woff2');
}

:root {
  --color-bg: #000000;
  --color-bg-secondary: #0a0a0a;
  --color-text: #ffffff;
  --color-text-secondary: #888888;
  --color-text-muted: #7a7a7a;   /* 原 #444444 对比度仅 2.16:1，不达 AA；#7a7a7a 为 4.89:1 */
  --color-accent: #1a1a1a;

  /* 字体栈：Inter 承包拉丁，Noto Sans SC 承包中文，系统字体兜底 */
  --font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto, Arial, sans-serif;
  --font-sans: var(--font-family);
  --font-serif: var(--font-family);

  /* 字重阶梯：全站只用三档 */
  --w-light: 300;
  --w-regular: 400;
  --w-medium: 500;

  /* 字距阶梯：改用 em，跟随字号等比缩放 */
  --ls-tight: 0.02em;
  --ls-wide: 0.08em;
  --ls-wider: 0.16em;
  --ls-widest: 0.24em;
  --ls-label: 0.4em;

  /* 行高阶梯 */
  --lh-display: 1.1;
  --lh-title: 1.3;
  --lh-body: 1.9;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  /* 深色底浅色字：开启灰度抗锯齿，笔画更细更干净 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 2.5rem 4rem;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
}

.navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(30px);
  padding: 1.5rem 4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: var(--w-medium);
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.14em;
  margin-right: -0.14em;
  line-height: 1.3;
  text-align: center;
  position: relative;
  z-index: 1;
}

.logo-en {
  font-size: 0.65rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wider);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
}

.nav-links {
  display: flex;
  gap: 4rem;
  align-items: center;
}

.nav-link {
  color: #888888;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wider);
  position: relative;
  transition: color 0.4s ease;
  padding-bottom: 4px;
  line-height: 1.4;
  text-align: center;
  z-index: 1;
}

.nav-link-en {
  font-size: 0.6rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wider);
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  transition: width 0.4s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

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

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn span {
  width: 26px;
  height: 1px;
  background-color: #ffffff;
  transition: all 0.4s ease;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  max-width: 320px;
  bottom: 0;
  background-color: transparent;
  backdrop-filter: blur(20px);
  z-index: 1000;
  padding: 100px 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
}

.mobile-menu.active {
  transform: translateX(0);
  visibility: visible;
}

.mobile-link {
  color: var(--color-text);
  text-decoration: none;
  text-align: right;
  width: 100%;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.active .mobile-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu.active .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-link:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu.active .mobile-link:nth-child(5) { transition-delay: 0.5s; }

.mobile-link-cn {
  font-size: 1.8rem;
  font-weight: var(--w-light);
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.mobile-link-en {
  font-size: 0.9rem;
  font-weight: var(--w-regular);
  letter-spacing: 0.12em;
  color: var(--color-text-secondary);
  line-height: 1.2;
}

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;   /* 移动端地址栏收放时不再跳动 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 这张封面是逆光树冠，本身极低调（中位亮度仅 24/255）。
     0.7 → 0.88 只是"没那么黑"，实测照片区仅 11% 灰，看起来像没加载。
     1.30 才是真正"看得见"：照片区 16% 灰，白字最亮处对比度 5.8:1（AA 要求 4.5:1）。
     上限 1.45 —— 再高文字对比度会掉到 4.5:1 以下。 */
  filter: brightness(1.30);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* 原为全屏三段式压暗，把整张照片一起压灰了。
     改为「文字后方局部暗角 + 极轻的上下渐变」，既保住文字对比度，又让照片透出来。 */
  background:
    radial-gradient(
      ellipse 70% 48% at 50% 42%,
      rgba(0, 0, 0, 0.58) 0%,
      rgba(0, 0, 0, 0.30) 55%,
      transparent 100%
    ),
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.28) 0%,
      rgba(0, 0, 0, 0.02) 45%,
      rgba(0, 0, 0, 0.42) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem;
}

.hero-label {
  font-size: 0.7rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-sans);
  font-size: 3.5rem;
  font-weight: var(--w-light);
  line-height: var(--lh-display);
  margin-bottom: 1.5rem;
  letter-spacing: 0.2em;
  /* 居中文本补偿：抵消末字后多出的字距，让视觉真正居中 */
  padding-left: 0.2em;
}

.hero-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 4rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-widest);
}

.hero-btn {
  display: inline-block;
  padding: 1.2rem 4rem;
  background-color: transparent;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: var(--w-regular);
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1);
}

.section {
  padding: 8rem 0;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 4rem;
  font-weight: var(--w-light);
  line-height: var(--lh-display);
  margin-bottom: 6rem;
  letter-spacing: 0.12em;
}

.about-content {
  max-width: 900px;
}

.about-text {
  text-align: left;
}

.about-lead {
  font-size: 1.6rem;
  color: var(--color-text);
  margin-bottom: 3rem;
  line-height: var(--lh-body);
  font-weight: var(--w-light);
}

.about-description {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.8rem;
  line-height: 1.95;
  font-weight: var(--w-light);
}

/* Portfolio Header & View Toggle */
.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.view-toggle {
  display: flex;
  gap: 1rem;
}

.view-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-secondary);
  padding: 0.8rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.3);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.3);
}

.view-btn svg {
  transition: transform 0.3s ease;
}

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

/* Portfolio Group */
.portfolio-group {
  margin-bottom: 3rem;
  transform-origin: center top;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-group:last-child {
  margin-bottom: 0;
}

.portfolio-group-title {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
}

.portfolio-group-title h3 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: var(--w-regular);
  color: var(--color-text);
  letter-spacing: var(--ls-tight);
}

.portfolio-group-role {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wide);
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  gap: 2rem;
  transition: grid-template-columns 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              gap 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-grid.list-view {
  grid-template-columns: 1fr;
}

.portfolio-grid.grid-view {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.portfolio-group {
  /* Animation will be controlled via JS inline styles */
}

.portfolio-item {
  /* Animation will be controlled via JS inline styles */
}

/* Grid view - keep titles with ellipsis */
.portfolio-grid.grid-view .portfolio-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  transform-origin: center top;
}

.portfolio-grid.grid-view .portfolio-group-title {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  padding-left: 0.2rem;
  align-items: flex-start;
  min-height: 2.5rem;
}

.portfolio-grid.grid-view .portfolio-group-title h3 {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: all 0.3s ease;
  line-height: 1.3;
}

.portfolio-grid.grid-view .portfolio-group:hover .portfolio-group-title h3 {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.portfolio-grid.grid-view .portfolio-group-role {
  font-size: 0.7rem;
}

/* Grid view items */
.portfolio-grid.grid-view .portfolio-item {
  width: 100%;
  margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  .portfolio-header {
    margin-bottom: 2rem;
  }
  
  .portfolio-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
  }
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  background-color: var(--color-accent);
  text-decoration: none;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
  opacity: 1;
}

.portfolio-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: brightness(0.85) saturate(0.9);
}

.portfolio-item.dimmed {
  transform: scale(0.98);
  opacity: 0.8;
}

.portfolio-item.active {
  transform: scale(1.08);
  opacity: 1;
}

.portfolio-item.active img {
  transform: scale(1.1);
  filter: brightness(1) saturate(1);
}

.portfolio-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.3) 35%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
}

.portfolio-item:hover .portfolio-item-overlay,
.portfolio-item.active .portfolio-item-overlay {
  opacity: 1;
}

.portfolio-item-title {
  font-size: 1.5rem;
  font-weight: var(--w-light);
  margin-bottom: 0.8rem;
  letter-spacing: 0.06em;
  transform: translateY(10px);
  transition: transform 0.5s ease, color 0.4s ease;
  color: var(--color-text);
}

.portfolio-item:hover .portfolio-item-title,
.portfolio-item.active .portfolio-item-title {
  transform: translateY(0);
}

.portfolio-item-role {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wide);
  transform: translateY(10px);
  transition: transform 0.5s ease 0.1s;
  margin-bottom: 0.5rem;
}

.portfolio-item:hover .portfolio-item-role,
.portfolio-item.active .portfolio-item-role {
  transform: translateY(0);
}

.portfolio-item-hint {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: var(--w-regular);
  letter-spacing: 0.06em;
  transform: translateY(10px);
  transition: transform 0.5s ease 0.2s, color 0.5s ease;
  font-style: normal;
}

.portfolio-item:hover .portfolio-item-hint,
.portfolio-item.active .portfolio-item-hint {
  transform: translateY(0);
  color: var(--color-text-secondary);
}

.contact-content {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: var(--w-regular);
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

.contact-value {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: var(--w-light);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.4s ease;
  letter-spacing: 0.08em;
  padding-left: 0.08em;
}

.contact-value:hover {
  color: var(--color-text-secondary);
  transform: translateY(-2px);
}

.footer {
  padding: 8rem 4rem;
  text-align: center;
  border-top: 1px solid var(--color-accent);
}

@media (max-width: 1200px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-title {
    font-size: 5.5rem;
  }

  .section-title {
    font-size: 3.2rem;
  }

  .nav-links {
    gap: 3rem;
  }

  .portfolio-item-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .hero-title {
    font-size: 4.5rem;
  }

  .section-title {
    font-size: 2.8rem;
  }

  .portfolio-item-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1.8rem 2rem;
  }

  .navbar.scrolled {
    padding: 1.2rem 2rem;
  }

  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-title {
    font-size: 3.2rem;
    letter-spacing: 0.12em;
    padding-left: 0.12em;
  }

  .hero-subtitle {
    font-size: 0.8rem;
    letter-spacing: var(--ls-wider);
  }

  .hero-btn {
    padding: 1rem 3rem;
    font-size: 0.7rem;
  }

  .section {
    padding: 6rem 0;
  }

  .container {
    padding: 0 2rem;
  }

  .section-title {
    font-size: 2.2rem;
    margin-bottom: 4rem;
    letter-spacing: 0.08em;
  }

  .about-lead {
    font-size: 1.3rem;
  }

  .about-description {
    font-size: 1rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .portfolio-item {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .portfolio-item.dimmed,
  .portfolio-item.active {
    transform: scale(1);
    opacity: 1;
  }

  .portfolio-item:hover,
  .portfolio-item.active:hover {
    transform: scale(1.08);
  }

  .portfolio-item:hover img,
  .portfolio-item.active img {
    transform: scale(1.1);
  }

  .portfolio-item-title {
    font-size: 1.2rem;
  }

  .portfolio-item-overlay {
    padding: 2.5rem;
  }

  .contact-content {
    padding: 0 2rem;
  }

  .contact-value {
    font-size: 1.6rem;
  }

  .footer {
    padding: 6rem 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.4rem;
    letter-spacing: 0.08em;
    padding-left: 0.08em;
  }

  .hero-label {
    font-size: 0.6rem;
  }

  .hero-btn {
    padding: 0.9rem 2.5rem;
    font-size: 0.65rem;
  }

  .section-title {
    font-size: 1.8rem;
    letter-spacing: 0.06em;
  }

  .portfolio-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .view-toggle {
    width: 100%;
    justify-content: flex-start;
  }

  .view-btn {
    padding: 1rem 1.5rem;
    min-width: 60px;
    min-height: 50px;
  }

  .portfolio-group-title {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .portfolio-group-title h3 {
    font-size: 1.2rem;
  }

  .portfolio-group-role {
    font-size: 0.7rem;
  }

  .portfolio-item-title {
    font-size: 1.1rem;
  }

  .portfolio-item-overlay {
    padding: 2rem;
  }

  .contact-value {
    font-size: 1.3rem;
  }
}

/* ============================================================
   手机端作品集：瀑布流（两列）默认版式
   只作用于 ≤640px —— 平板最短边是 768px（iPad 竖屏），所以平板
   与桌面完全不受这段影响，版式保持原样。
   为什么这里必须显式写 repeat(2, 1fr)，而不能沿用 minmax：
   grid-view 的列宽本来来自 minmax(350px, 1fr)。360px 手机上
   .container 左右各 2rem，可用宽度只剩 296px，350px 的轨道塞不进
   296px 的容器，右侧多出来的部分会被 body{overflow-x:hidden} 静默裁掉。
   也就是说：改之前手机上的"瀑布流"其实是一列被切了右边 54px。
   1fr 轨道恒等于容器宽度，永远不会溢出，也不会再被裁。
   ============================================================ */
@media (max-width: 640px) {
  .portfolio-grid.grid-view {
    /* 必须写 minmax(0, 1fr)，不能用 1fr：
       `1fr` 会被解析成 `minmax(auto, 1fr)`，那个 auto 就是网格项的
       自动最小尺寸。实测 390px 下两列被撑成 168.8px / 172.2px，
       合计 353px > 容器 326px，第二列直接被 body{overflow-x:hidden}
       切掉。显式写 0 才能让轨道真正收缩到容器宽度。
       （桌面端用 minmax(350px,1fr)，最小值写死，所以从没暴露这问题。） */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.75rem;
  }

  /* 双保险：网格项也允许被压缩，组名才能正常走省略号 */
  .portfolio-grid.grid-view .portfolio-group {
    min-width: 0;
  }

  .portfolio-grid.grid-view .portfolio-group-title {
    min-height: 0;
    margin-bottom: 0.4rem;
    padding-left: 0;
    gap: 0.15rem;
    min-width: 0;
  }

  /* 单块缩略图只有 ~150px 宽，组名压到 0.8rem 才不至于被省略号吃掉 */
  .portfolio-grid.grid-view .portfolio-group-title h3 {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
  }

  .portfolio-grid.grid-view .portfolio-group-role {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }

  .portfolio-grid.grid-view .portfolio-item-overlay {
    padding: 0.75rem;
  }

  .portfolio-grid.grid-view .portfolio-item-hint {
    font-size: 0.62rem;
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 3rem;
  right: 3rem;
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 100;
  backdrop-filter: blur(10px);
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--color-text);
  transform: translateY(-3px);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile - smaller button */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
  }
  
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 2001;
  transition: opacity 0.3s ease;
  opacity: 0.7;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  width: 30px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.5;
  z-index: 2001;
}

.lightbox-nav:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 0;
}

.lightbox-next {
  right: 0;
}

.lightbox-images {
  position: relative;
  max-width: 90%;
  max-height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  cursor: pointer;
  transition: opacity 0.5s ease;
  position: absolute;
  opacity: 0;
  left: 0;
}

.lightbox-image.active {
  position: relative;
  opacity: 1;
  z-index: 1;
}

.lightbox-image:hover {
  transform: scale(1.02);
}

.lightbox-image.active:hover {
  transform: scale(1.02);
}

.lightbox-dots {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  z-index: 2001;
}

.lightbox-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-dot.active {
  background: #fff;
  transform: scale(1.2);
}

.lightbox-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.lightbox-caption {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox-hint {
  color: #888;
  font-size: 14px;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-tight);
}

.lightbox-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  letter-spacing: var(--ls-wide);
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.lightbox-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .lightbox-close {
    top: 15px;
    right: 20px;
    font-size: 30px;
  }
  
  .lightbox-nav {
    font-size: 16px;
    width: 25px;
    height: 50px;
  }
  
  .lightbox-prev {
    left: 5px;
  }
  
  .lightbox-next {
    right: 5px;
  }
  
  .lightbox-image {
    max-width: 95%;
    max-height: 70vh;
  }
  
  .lightbox-dot {
    width: 8px;
    height: 8px;
  }
  
  .lightbox-caption {
    padding: 0 20px;
  }
  
  .lightbox-hint {
    font-size: 12px;
  }
  
  .lightbox-link {
    padding: 10px 24px;
    font-size: 13px;
  }
}

/* ============================================================
   无障碍与体验补强
   ============================================================ */

/* ── 键盘焦点可见（深色站上默认焦点环几乎看不见）── */
:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  border-radius: 2px;
}

.lightbox :focus-visible {
  outline-offset: 4px;
}

/* ── 尊重系统「减少动态效果」偏好 ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .portfolio-group,
  .portfolio-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── 章节标题的中文副标题：与导航的双语结构对齐 ── */
.section-title-cn {
  display: block;
  margin-top: 1.4rem;
  font-size: 0.7rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-label);
  color: var(--color-text-secondary);
}

/* ── 滚动渐入（由 IntersectionObserver 驱动）── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* ── Footer（原本是个空标签，只有一条边框线）── */
.footer {
  padding: 5rem 4rem 4rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1800px;
  margin: 0 auto;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-name {
  font-size: 1.1rem;
  font-weight: var(--w-medium);
  letter-spacing: 0.08em;
  color: var(--color-text);
}

.footer-name span {
  margin-left: 0.45em;
  font-weight: var(--w-light);
  color: var(--color-text-secondary);
}

.footer-role {
  font-size: 0.72rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wider);
  color: var(--color-text-muted);
}

.footer-link {
  font-size: 0.82rem;
  font-weight: var(--w-light);
  letter-spacing: var(--ls-wide);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: 0.7rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-tight);
  color: var(--color-text-muted);
}

.footer-top {
  font-size: 0.7rem;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wider);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-top:hover {
  color: var(--color-text);
}

/* ── 灯箱：原先关闭按钮是 div，键盘完全够不着 ── */
.lightbox-close {
  padding: 0 0.25em;
  background: none;
  border: none;
  line-height: 1;
  font-family: var(--font-sans);
}

.lightbox-dot {
  padding: 0;
  border: none;
}

.lightbox-autoplay {
  margin-top: 14px;
  padding: 6px 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #888888;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--w-regular);
  letter-spacing: var(--ls-wide);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
  z-index: 2001;
}

.lightbox-autoplay:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ── 移动端：footer 与服务内容纵向堆叠 ── */
@media (max-width: 768px) {
  .footer {
    padding: 4rem 2rem 3rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 2rem;
  }


  .section-title-cn {
    margin-top: 1rem;
    letter-spacing: 0.28em;
  }
}
