/* =========================================================
   仁青多日杰 · Portfolio
   Dark / restrained / editorial-tech
   ========================================================= */

:root {
  --bg:            #0a0b0d;
  --bg-soft:       #101216;
  --surface:       #14171c;
  --surface-2:     #191d24;
  --line:          rgba(255,255,255,0.08);
  --line-strong:   rgba(255,255,255,0.16);
  --text:          #eef1f5;
  --text-soft:     #9aa3ad;
  --text-dim:      #626a74;
  --accent:        #5eead4;   /* 克制的青绿科技点缀 */
  --accent-deep:   #2dd4bf;
  --accent-glow:   rgba(94,234,212,0.16);

  --font-en: 'Sora', system-ui, sans-serif;
  --font-cn: 'Noto Sans SC', system-ui, sans-serif;

  --maxw: 1240px;
  --pad: clamp(20px, 5vw, 80px);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-cn);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #04120f; }

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ---------- 背景层 ---------- */
.bg-layer { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.5; }
.bg-glow--1 { width: 46vw; height: 46vw; top: -12vw; left: -8vw; background: radial-gradient(circle, rgba(45,212,191,0.20), transparent 70%); }
.bg-glow--2 { width: 40vw; height: 40vw; bottom: -14vw; right: -6vw; background: radial-gradient(circle, rgba(80,120,255,0.14), transparent 70%); }
.bg-noise {
  position: absolute; inset: 0; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 光标微光（仅 PC，JS 控制位置） */
.cursor-glow {
  position: fixed; z-index: -1; width: 420px; height: 420px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  transform: translate(-50%, -50%); left: 50%; top: 30%;
  opacity: 0; transition: opacity 0.6s var(--ease);
}

/* ---------- 通用 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(80px, 12vh, 160px) var(--pad);
}
.section__head { margin-bottom: clamp(40px, 6vw, 72px); }
.section__index {
  font-family: var(--font-en); font-size: 0.8rem; letter-spacing: 0.3em;
  color: var(--accent); font-weight: 600;
}
.section__title {
  font-family: var(--font-en); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05;
  letter-spacing: -0.02em; margin-top: 12px;
}
/* 模块英文大标题：超大、描边质感、克制 */
.section__display {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(3.2rem, 13vw, 11rem);
  line-height: 0.9; letter-spacing: -0.04em;
  margin: 6px 0 2px; color: transparent;
  -webkit-text-stroke: 1px rgba(238,241,245,0.14);
  text-stroke: 1px rgba(238,241,245,0.14);
  background: linear-gradient(180deg, rgba(238,241,245,0.10), rgba(238,241,245,0.02));
  -webkit-background-clip: text; background-clip: text;
  pointer-events: none; user-select: none;
}
.section__desc { color: var(--text-soft); max-width: 560px; margin-top: 18px; font-size: 1.02rem; }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); display: inline-block;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.4;transform:scale(.7);} }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 100px;
  font-family: var(--font-en); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em; cursor: pointer; border: 1px solid transparent;
  transition: transform .5s var(--ease), background .4s var(--ease), box-shadow .5s var(--ease), color .4s var(--ease);
}
.btn svg { transition: transform .5s var(--ease); }
.btn--primary { background: var(--accent); color: #04120f; box-shadow: 0 0 0 rgba(94,234,212,0); }
.btn--primary:hover { background: #ffffff; color: #04120f; transform: translateY(-3px); box-shadow: 0 14px 40px -10px var(--accent-glow), 0 0 30px -6px var(--accent-glow); }
.btn--primary:hover svg { transform: translateX(4px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { background: var(--accent); border-color: var(--accent); color: #04120f; transform: translateY(-3px); box-shadow: 0 12px 34px -12px var(--accent-glow); }
.btn--ghost:hover svg { transform: translateX(3px); }

/* ---------- CardNav 导航 ---------- */
.card-nav-container {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  z-index: 100;
  box-sizing: border-box;
}

.card-nav {
  display: block;
  height: 60px;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  will-change: height;
  transition: background-color 0.3s ease;
}

.card-nav-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.45rem 0.55rem 1.1rem;
  z-index: 2;
}

.hamburger-menu {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 6px;
  padding: 0 8px;
  transition: opacity 0.3s ease;
}

.hamburger-menu:hover {
  opacity: 0.75;
}

.hamburger-line {
  width: 30px;
  height: 2px;
  background-color: #000;
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: 50% 50%;
}

.hamburger-menu.open .hamburger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.hamburger-menu.open .hamburger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.logo-container {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav__logo-mark {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.95rem;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.nav__logo-text {
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: #000;
}

.card-nav-cta-button {
  background-color: #0a0b0d;
  color: white;
  border: none;
  border-radius: calc(0.75rem - 0.35rem);
  padding: 0 1rem;
  height: calc(100% - 4px);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.card-nav-cta-button:hover {
  background-color: var(--accent);
  color: #04120f;
}

.card-nav-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 60px;
  bottom: 0;
  padding: 0.5rem;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.card-nav.open .card-nav-content {
  visibility: visible;
  pointer-events: auto;
}

.nav-card {
  height: 100%;
  flex: 1 1 0;
  min-width: 0;
  border-radius: calc(0.75rem - 0.2rem);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  gap: 12px;
  user-select: none;
  opacity: 0;
  transform: translateY(50px);
}

.nav-card[data-card="0"] {
  background: linear-gradient(135deg, #1B1722, #2a2433);
  color: #fff;
}

.nav-card[data-card="1"] {
  background: linear-gradient(135deg, #2F293A, #3d3547);
  color: #fff;
}

.nav-card[data-card="2"] {
  background: linear-gradient(135deg, #2F293A, #3d3547);
  color: #fff;
}

.nav-card-label {
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.5px;
  font-family: var(--font-en);
}

.nav-card-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-card-link {
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  padding: 4px 0;
}

.nav-card-link:hover {
  opacity: 0.75;
}

.nav-card-link-icon {
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .card-nav-container {
    width: 90%;
    top: 1.2rem;
  }

  .card-nav-top {
    padding: 0.5rem 1rem;
    justify-content: space-between;
  }

  .hamburger-menu {
    order: 2;
  }

  .logo-container {
    position: static;
    transform: none;
    order: 1;
  }

  .card-nav-cta-button {
    display: none;
  }

  .card-nav-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0.5rem;
    justify-content: flex-start;
  }

  .nav-card {
    height: auto;
    min-height: 80px;
    flex: 1 1 auto;
  }

  .nav-card-label {
    font-size: 18px;
  }

  .nav-card-link {
    font-size: 14px;
  }
}

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--pad) 80px; max-width: var(--maxw); margin: 0 auto;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(0.7) contrast(1.05) saturate(1.05);
}
.hero__collage {
  position: absolute; inset: -6% -2%;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr;
  gap: 14px; opacity: 0.5;
}
.hero__tile { overflow: hidden; border-radius: 12px; transform: translateY(0); animation: floatTile 14s ease-in-out infinite; animation-delay: calc(var(--d) * -2.3s); }
.hero__tile img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.3) contrast(1.05); }
@keyframes floatTile { 0%,100%{ transform: translateY(-10px);} 50%{ transform: translateY(10px);} }
.hero__scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 25% 45%, rgba(10,11,13,0.62), transparent 72%),
    linear-gradient(90deg, var(--bg) 0%, rgba(10,11,13,0.80) 40%, rgba(10,11,13,0.42) 100%),
    linear-gradient(0deg, var(--bg) 3%, rgba(10,11,13,0.25) 30%, transparent 55%);
}
.hero__content { position: relative; max-width: 780px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-en); font-size: 0.82rem; letter-spacing: 0.28em;
  color: var(--text-soft); margin-bottom: 16px; font-weight: 500;
}
.hero__title {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 6rem); line-height: 0.98;
  letter-spacing: -0.03em; margin-bottom: 30px;
}
.hero__title span { display: block; overflow: hidden; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub {
  color: var(--text-soft); font-size: clamp(1rem, 1.6vw, 1.18rem);
  max-width: 620px; margin-bottom: 40px; line-height: 1.8;
}
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 40px; left: var(--pad);
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-en); font-size: 0.72rem; letter-spacing: 0.3em; color: var(--text-dim);
}
.hero__scroll-line { width: 60px; height: 1px; background: var(--line-strong); position: relative; overflow: hidden; }
.hero__scroll-line::after { content:''; position:absolute; inset:0; width: 30%; background: var(--accent); animation: scrollLine 2.4s var(--ease) infinite; }
@keyframes scrollLine { 0%{transform:translateX(-100%);} 100%{transform:translateX(300%);} }

/* ---------- ABOUT ---------- */
.about__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.about__portrait { position: sticky; top: 100px; }
.about__portrait-frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4/5; background: var(--surface);
}
.about__portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; transition: transform 1.2s var(--ease); }
.about__portrait-frame:hover img { transform: scale(1.05); }
.about__portrait-frame::after { content:''; position:absolute; inset:0; background: linear-gradient(0deg, rgba(10,11,13,0.7), transparent 45%); }
.about__portrait-tag { position: absolute; left: 20px; bottom: 18px; z-index: 2; }
.about__portrait-name { display: block; font-size: 1.05rem; font-weight: 500; }
.about__portrait-en { display: block; font-family: var(--font-en); font-size: 0.72rem; letter-spacing: 0.24em; color: var(--accent); margin-top: 4px; }

.about__lead { font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 400; line-height: 1.5; letter-spacing: -0.01em; margin-bottom: 26px; }
.about__text { color: var(--text-soft); font-size: 1.05rem; line-height: 1.9; margin-bottom: 40px; }
.about__facts { list-style: none; border-top: 1px solid var(--line); margin-bottom: 40px; }
.about__facts li { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.about__facts .k { color: var(--text-dim); font-family: var(--font-en); font-size: 0.82rem; letter-spacing: 0.1em; padding-top: 2px; }
.about__facts .v { color: var(--text); font-size: 1.02rem; }
.about__contact { display: flex; gap: 14px; flex-wrap: wrap; }
.about__contact-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border: 1px solid var(--line); border-radius: 100px;
  color: var(--text-soft); font-size: 0.95rem; transition: all .4s var(--ease);
}
.about__contact-item:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.about__contact-item svg { color: var(--accent); }

/* ---------- WORK ---------- */
/* 子标题：视频 / 图集 */
.work__subhead { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.work__subhead--gap { margin-top: 88px; }
.work__subtitle { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 500; letter-spacing: -0.01em; display: flex; align-items: center; gap: 16px; }
.work__num { font-family: var(--font-en); font-size: 0.85rem; font-weight: 700; color: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 9px; }
.work__count { font-family: var(--font-en); font-size: 0.76rem; letter-spacing: 0.28em; color: var(--text-dim); }

/* 按朝向分行的网格 */
.work__row { display: grid; gap: 20px; margin-bottom: 20px; }
.work__row--land { grid-template-columns: repeat(2, 1fr); }   /* 横屏：2 列 × 4 行 = 8 */
.work__row--port { grid-template-columns: repeat(3, 1fr); }   /* 竖屏：3 列 × 2 行 = 6 */

/* 卡片：用真实比例，绝不裁切变形 */
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.ratio-land { aspect-ratio: 16 / 9; }
.ratio-port { aspect-ratio: 9 / 16; }
.card__media { position: absolute; inset: 0; }
/* 视频卡骨架底色：代表帧定格前显示 */
.card--video .card__media {
  background:
    radial-gradient(circle at 50% 40%, rgba(94,234,212,0.06), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--bg-soft));
}
/* 图片加载错误占位符 */
.card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-soft));
  color: var(--text-dim);
  font-size: 0.9rem;
}
.card__placeholder svg {
  opacity: 0.4;
}
.card--img-error .card__media {
  background: linear-gradient(135deg, var(--surface-2), var(--bg-soft));
}
.card__video { opacity: 1; transition: transform 1.1s var(--ease), filter .6s var(--ease); }
.card--playing .card__video { opacity: 1; }
.card__media img, .card__video { width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease), transform 1.1s var(--ease), filter .6s var(--ease); }
.card img { filter: brightness(0.82) saturate(1.02); }
.card:hover img, .card:hover .card__video { transform: scale(1.06); filter: brightness(0.7); }
.card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,9,11,0.92) 0%, rgba(8,9,11,0.15) 45%, transparent 70%);
  transition: opacity .5s var(--ease);
}
.card__info {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 3;
  padding: 0;
  display: inline-block;
}
.card__tags { display: none; }
.card__title {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  background: rgba(14,17,23,0.85);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-block;
  margin: 0;
}
.card__desc { display: none; }

/* 中间播放按钮 */
.card__play-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(14,17,23,0.85);
  border: 2px solid rgba(255,255,255,0.3);
  color: var(--text);
  backdrop-filter: blur(8px);
  transition: all .4s var(--ease);
  opacity: 1;
}
.card__play-center .pause-icon { display: none; }
.card--playing .card__play-center { opacity: 0; pointer-events: none; }
.card:hover .card--playing .card__play-center { opacity: 1; pointer-events: auto; }
.card--playing .card__play-center .play-icon { display: none; }
.card--playing .card__play-center .pause-icon { display: block; }
.card__play-center:hover {
  background: var(--accent);
  color: #04120f;
  border-color: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 30px rgba(94,234,212,0.4);
}

/* 右上角音量按钮 */
.card__sound-toggle {
  position: absolute;
  z-index: 4;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(14,17,23,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  backdrop-filter: blur(6px);
  transition: all .4s var(--ease);
}
.card__sound-toggle .sound-off-icon { display: none; }
.card--muted .card__sound-toggle .sound-on-icon { display: none; }
.card--muted .card__sound-toggle .sound-off-icon { display: block; }
.card--muted .card__sound-toggle {
  border-color: rgba(255,100,100,0.5);
  color: rgba(255,100,100,0.8);
}
.card__sound-toggle:hover {
  background: var(--accent);
  color: #04120f;
  border-color: var(--accent);
  transform: scale(1.08);
}
.card--playing::after { opacity: 0.35; }

/* ---------- SKILLS ---------- */
.skills__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill {
  padding: 34px 30px; border-radius: var(--radius);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  position: relative; overflow: hidden; transition: border-color .5s var(--ease), transform .6s var(--ease);
}
.skill::before {
  content:''; position:absolute; top:0; left:0; right:0; height:1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .5s var(--ease);
}
.skill:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.skill:hover::before { opacity: 1; }
.skill__icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--accent);
  margin-bottom: 22px; transition: all .5s var(--ease);
}
.skill:hover .skill__icon { background: var(--accent-glow); box-shadow: 0 0 24px -6px var(--accent-glow); }
.skill__title { font-size: 1.2rem; font-weight: 500; margin-bottom: 12px; }
.skill__desc { color: var(--text-soft); font-size: 0.95rem; line-height: 1.75; }

/* 时间线 */
.timeline { margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); }
.timeline__title { font-family: var(--font-en); font-size: 0.9rem; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 28px; text-transform: uppercase; }
.timeline__list { list-style: none; }
.timeline__item {
  display: grid; grid-template-columns: 200px 1fr 260px; gap: 24px; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--line);
  transition: padding-left .4s var(--ease), background .4s var(--ease);
}
.timeline__item:hover { padding-left: 16px; }
.timeline__time { font-family: var(--font-en); color: var(--text-soft); font-size: 0.9rem; }
.timeline__org { font-size: 1.05rem; font-weight: 400; }
.timeline__role { color: var(--text-dim); font-size: 0.92rem; text-align: right; }

/* ---------- CONTACT ---------- */
.contact {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; max-width: 100%; padding-left: var(--pad); padding-right: var(--pad);
  overflow: hidden;
}
/* PlasmaWave 背景模块（React Bits 组件移植） */
.contact__plasma {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 55%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 55%, #000 30%, transparent 82%);
}
.contact__plasma canvas { display: block; width: 100%; height: 100%; }
.contact__inner { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; width: 100%; text-align: center; padding: 80px 0 40px; }
.contact__eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-en); font-size: 0.82rem; letter-spacing: 0.28em; color: var(--text-soft); margin-bottom: 30px; }
.contact__title { font-family: var(--font-en); font-weight: 700; font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1.05; letter-spacing: -0.03em; margin-bottom: 28px; }
.contact__sub { color: var(--text-soft); font-size: 1.1rem; max-width: 520px; margin: 0 auto 40px; }
.contact__mail {
  display: inline-block; font-family: var(--font-en); font-weight: 600;
  font-size: clamp(1.3rem, 3.5vw, 2.2rem); color: var(--accent);
  padding-bottom: 8px; border-bottom: 1px solid var(--accent-glow);
  transition: border-color .4s var(--ease), letter-spacing .5s var(--ease); margin-bottom: 64px;
}
.contact__mail:hover { border-color: var(--accent); letter-spacing: 0.02em; }
.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 800px; margin: 0 auto; }
.contact__card {
  padding: 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left; transition: all .5s var(--ease);
}
.contact__card:not(div):hover { border-color: var(--accent); transform: translateY(-4px); }
.contact__card-k { display: block; font-family: var(--font-en); font-size: 0.76rem; letter-spacing: 0.16em; color: var(--text-dim); margin-bottom: 10px; text-transform: uppercase; }
.contact__card-v { display: block; font-size: 1.05rem; color: var(--text); }

.footer {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: 40px 0; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  color: var(--text-dim); font-size: 0.85rem;
}
.footer__meta { font-family: var(--font-en); letter-spacing: 0.06em; }

/* ---------- 动效：初始态（.gsap-ready 由 <head> 内联脚本在首绘前添加，避免闪烁；JS 关闭则不隐藏） ---------- */
.gsap-ready:not(.reduce-motion) [data-reveal],
.gsap-ready:not(.reduce-motion) [data-display] { opacity: 0; }
.gsap-ready:not(.reduce-motion) [data-reveal],
.gsap-ready:not(.reduce-motion) [data-display] { will-change: transform, opacity; }
/* 开场：隐藏 hero 内容与导航，交给 opening timeline */
.gsap-ready:not(.reduce-motion) .hero__content > *,
.gsap-ready:not(.reduce-motion) .hero__scroll,
.gsap-ready:not(.reduce-motion) .nav { opacity: 0; }
/* 动效全部就绪后释放 will-change */
.motion-done [data-reveal],
.motion-done [data-display] { will-change: auto; }
/* 失效保护：动效脚本未接管时强制显示所有内容 */
.motion-failed [data-reveal],
.motion-failed [data-display],
.motion-failed .hero__content > *,
.motion-failed .hero__scroll,
.motion-failed .nav { opacity: 1 !important; transform: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .work__row--port { grid-template-columns: repeat(3, 1fr); }
  .timeline__item { grid-template-columns: 170px 1fr 200px; gap: 16px; }
}

@media (max-width: 820px) {
  .hide-mobile { display: none; }

  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { position: relative; top: 0; max-width: 360px; }

  /* 横屏卡单列，竖屏卡两列 */
  .work__row--land { grid-template-columns: 1fr; }
  .work__row--port { grid-template-columns: repeat(2, 1fr); }

  .skills__grid { grid-template-columns: 1fr 1fr; }
  .timeline__item { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .timeline__role { text-align: left; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .hero { padding-top: 100px; }
  /* 手机：横屏单列，竖屏仍两列（竖图窄，两列更紧凑好看） */
  .work__row--land { grid-template-columns: 1fr; }
  .work__row--port { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* 移动端按钮缩小 */
  .card__play-center { width: 60px; height: 60px; }
  .card__play-center svg { width: 26px; height: 26px; }
  .card__sound-toggle { width: 36px; height: 36px; top: 12px; right: 12px; }
  .card__sound-toggle svg { width: 16px; height: 16px; }
  /* 移动端标题调整 */
  .card__info { left: 12px; bottom: 12px; }
  .card__title { font-size: 0.85rem; padding: 8px 12px; }
  .skills__grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; text-align: center; }
  .about__contact { flex-direction: column; }
  .about__contact-item { justify-content: center; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ========== MaskedHeading (React Bits 组件移植) ========== */
.masked-heading {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  text-wrap: balance;
  -webkit-font-smoothing: antialiased;
}
.masked-heading__measure { color: transparent; }
.masked-heading__word { display: inline-block; white-space: pre; }
.masked-heading__word:not(:last-child)::after { content: ' '; }
.masked-heading__baseline { display: inline-block; width: 0; height: 0; }
.masked-heading__defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.masked-heading__reveal { position: absolute; inset: 0; display: block; pointer-events: none; }
.masked-heading__clip { position: absolute; inset: 0; display: block; }
.masked-heading__media { position: absolute; inset: 0; display: block; will-change: transform, filter; }
.masked-heading__source {
  display: block; width: 100%; height: 100%; object-fit: cover;
  user-select: none; -webkit-user-drag: none;
}

/* 用于 Hero 主标题：让遮罩标题继承原有排版与尺寸 */
.hero__title--masked {
  font-family: var(--font-en);
  font-size: clamp(2.6rem, 8vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 30px;
  color: transparent;      /* 文字本体透明，仅露出媒体填充 */
}
.hero__title--masked .masked-heading__measure { text-align: left; }

/* ========== FoldText (React Bits 组件移植) ========== */
.fold-text {
  display: inline-block;
  color: var(--fold-text-color, currentColor);
  font-size: var(--fold-text-font-size, inherit);
  font-weight: var(--fold-text-font-weight, inherit);
  line-height: 0.95;
  letter-spacing: -0.04em;
  white-space: pre-wrap;
  user-select: text;
}
.fold-text-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.fold-text-visual { display: inline; }
.fold-text-line { display: block; }
.fold-text-whitespace { display: inline; }
.fold-text-segment {
  display: inline-block; line-height: inherit;
  perspective: var(--fold-perspective, 700px);
  transform-style: preserve-3d; vertical-align: baseline;
}
.fold-text-segment[data-fold-split='line'] { display: block; }
.fold-text-piece {
  position: relative; display: inline-block; color: inherit; line-height: inherit;
  transform-style: preserve-3d; backface-visibility: hidden;
  will-change: transform, opacity;
}
.fold-text-piece::after {
  content: ''; position: absolute; inset: -0.08em -0.02em; pointer-events: none;
  opacity: var(--fold-crease, 0); mix-blend-mode: multiply; border-radius: 0.08em;
}
.fold-text-piece[data-fold-hinge='top']::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.22) 42%, rgba(255,255,255,0.26) 100%);
}
.fold-text-piece[data-fold-hinge='bottom']::after {
  background: linear-gradient(0deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.22) 42%, rgba(255,255,255,0.26) 100%);
}
.fold-text-piece[data-fold-hinge='left']::after {
  background: linear-gradient(90deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.22) 42%, rgba(255,255,255,0.26) 100%);
}
.fold-text-piece[data-fold-hinge='right']::after {
  background: linear-gradient(270deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.22) 42%, rgba(255,255,255,0.26) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .fold-text-piece { transform: none !important; }
  .fold-text-piece::after { opacity: 0 !important; }
}

/* Hero 主标题使用 FoldText 时的排版 */
.hero__title--fold { margin-bottom: 30px; }
.hero__title--fold .fold-text {
  font-family: var(--font-en);
  letter-spacing: -0.03em;
}
.hero__title--fold .fold-line { display: block; }

/* ========== WarpText (React Bits 组件移植) ========== */
.warp-text {
  position: relative;
  display: block;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  isolation: isolate;
  border-radius: inherit;
}
.warp-text canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}

/* Hero 主标题：两排横向 WarpText */
.hero__title--warp {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hero__title--warp .warp-row {
  width: 100%;
  height: clamp(72px, 15vw, 150px);
  min-height: 0;
}
@media (max-width: 540px) {
  .hero__title--warp .warp-row { height: clamp(56px, 18vw, 96px); }
}

/* ========== Opening animation：幕布 ========== */
.intro-curtain {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: grid; place-items: center;
  will-change: transform;
}
.intro-curtain::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(45,212,191,0.08), transparent 60%),
    linear-gradient(180deg, #0c0e12, #08090b);
  z-index: -1;
}
.intro-curtain__mark {
  font-family: var(--font-en); font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: 0.04em;
  color: var(--accent); opacity: 0;
}
/* 联系区英文大标题：居中 */
.contact__display { text-align: center; margin: 4px 0 10px; }
.contact__inner .section__display { -webkit-text-stroke-color: rgba(238,241,245,0.16); }

/* parallax：媒体容器 overscan，避免上下移动露边
   注意：.card__play / .card__sound-badge 必须放在 .card__media 外面（.card 的直接子元素），
   否则会跟着 overscan + yPercent 位移，在 9:16 竖屏卡上被裁到卡片外看不见。 */
.card__media { top: -8%; bottom: -8%; height: auto; }




/* ---------- GooeyNav 导航 ---------- */
:root {
  --color-1: #5EEAD4;
  --color-2: #6478FF;
  --color-3: #A78BFA;
  --color-4: #F472B6;
}

.gooey-nav-wrapper {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 100%;
  display: flex;
  justify-content: center;
}

.gooey-nav-container {
  position: relative;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  isolation: isolate;
}

.gooey-nav-container nav {
  display: flex;
  position: relative;
  transform: translate3d(0, 0, 0.01px);
}

.gooey-nav-container nav ul {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 3;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gooey-nav-container nav ul li {
  border-radius: 100vw;
  position: relative;
  cursor: pointer;
  transition: color 0.3s ease;
}

.gooey-nav-container nav ul li a {
  display: inline-block;
  padding: 0.7em 1.5em;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  font-family: var(--font-cn);
}

.gooey-nav-container nav ul li:focus-within:has(:focus-visible) {
  box-shadow: 0 0 0 2px var(--accent);
}

.gooey-nav-container nav ul li::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 100vw;
  background: white;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: -1;
}

.gooey-nav-container nav ul li.active {
  color: #0a0b0d;
  text-shadow: none;
}

.gooey-nav-container nav ul li.active::after {
  opacity: 1;
  transform: scale(1);
}

.gooey-nav-container .effect {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
  z-index: 1;
  transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.gooey-nav-container .effect.text {
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font-cn);
  transition: color 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gooey-nav-container .effect.text.active {
  color: #0a0b0d;
  text-shadow: none;
}

.gooey-nav-container .effect.filter {
  filter: blur(7px) contrast(100) blur(0);
  mix-blend-mode: lighten;
  overflow: visible;
  clip-path: inset(-100px -100px -100px -100px);
}

.gooey-nav-container .effect.filter::before {
  content: '';
  position: absolute;
  inset: -75px;
  z-index: -2;
  background: rgba(10, 11, 13, 0.85);
  border-radius: 100px;
  clip-path: inset(30px 30px 30px 30px round 100px);
}

.gooey-nav-container .effect.filter::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  transform: scale(0);
  opacity: 0;
  z-index: -1;
  border-radius: 100vw;
}

.gooey-nav-container .effect.active::after {
  animation: pill 0.3s ease both;
}

@keyframes pill {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.particle,
.point {
  display: block;
  opacity: 0;
  width: 20px;
  height: 20px;
  border-radius: 100%;
  transform-origin: center;
}

.particle {
  --time: 5s;
  position: absolute;
  top: calc(50% - 10px);
  left: calc(50% - 10px);
  animation: particle calc(var(--time)) ease 1 -350ms;
}

.point {
  background: var(--color);
  opacity: 1;
  animation: point calc(var(--time)) ease 1 -350ms;
}

@keyframes particle {
  0% {
    transform: rotate(0deg) translate(calc(var(--start-x)), calc(var(--start-y)));
    opacity: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  70% {
    transform: rotate(calc(var(--rotate) * 0.5)) translate(calc(var(--end-x) * 1.2), calc(var(--end-y) * 1.2));
    opacity: 1;
    animation-timing-function: ease;
  }
  85% {
    transform: rotate(calc(var(--rotate) * 0.66)) translate(calc(var(--end-x)), calc(var(--end-y)));
    opacity: 1;
  }
  100% {
    transform: rotate(calc(var(--rotate) * 1.2)) translate(calc(var(--end-x) * 0.5), calc(var(--end-y) * 0.5));
    opacity: 1;
  }
}

@keyframes point {
  0% {
    transform: scale(0);
    opacity: 0;
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  25% {
    transform: scale(calc(var(--scale) * 0.25));
  }
  38% {
    opacity: 1;
  }
  65% {
    transform: scale(var(--scale));
    opacity: 1;
    animation-timing-function: ease;
  }
  85% {
    transform: scale(var(--scale));
    opacity: 1;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* 移动端响应式 */
@media (max-width: 820px) {
  .gooey-nav-wrapper {
    top: 1rem;
  }

  .gooey-nav-container {
    padding: 0.4rem 0.8rem;
  }

  .gooey-nav-container nav ul {
    gap: 0.2rem;
  }

  .gooey-nav-container nav ul li a {
    padding: 0.6em 1em;
    font-size: 0.85rem;
  }

  .gooey-nav-container .effect.text {
    font-size: 0.85rem;
  }
}

@media (max-width: 540px) {
  .gooey-nav-container nav ul {
    gap: 0;
  }

  .gooey-nav-container nav ul li a {
    padding: 0.5em 0.8em;
    font-size: 0.8rem;
  }

  .gooey-nav-container .effect.text {
    font-size: 0.8rem;
  }
}

/* Hero tagline - 标语 */
.hero__tagline {
  font-family: var(--font-cn);
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-bottom: 24px;
  margin-top: -8px;
  text-shadow: 0 0 30px rgba(94, 234, 212, 0.4);
}

@media (max-width: 820px) {
  .hero__tagline {
    font-size: 2rem;
    margin-bottom: 20px;
  }
}
/* ---------- Dock 导航 ---------- */
.dock-outer {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.dock-panel {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(18, 15, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.25rem;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  transition: padding 0.3s ease;
}

.dock-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(30, 27, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition:
    width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease,
    transform 0.2s ease;
  transform-origin: bottom center;
}

.dock-item:hover {
  background: rgba(40, 37, 48, 0.8);
  transform: translateY(-8px);
}

.dock-item .dock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s ease;
  text-decoration: none;
}

.dock-item:hover .dock-icon {
  color: var(--accent);
}

.dock-item .dock-icon svg {
  flex-shrink: 0;
}

.dock-label {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  white-space: nowrap;
  padding: 0.4rem 0.8rem;
  background: rgba(18, 15, 23, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Dock 放大效果 - 相邻项目也会受影响 */
.dock-item.magnify-2 { width: 54px; height: 54px; }
.dock-item.magnify-1 { width: 62px; height: 62px; }
.dock-item.magnify-0 { width: 70px; height: 70px; }

/* 移动端响应式 */
@media (max-width: 820px) {
  .dock-outer {
    bottom: 1rem;
  }

  .dock-panel {
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
  }

  .dock-item {
    width: 44px;
    height: 44px;
  }

  .dock-item .dock-icon svg {
    width: 18px;
    height: 18px;
  }

  .dock-item.magnify-2 { width: 46px; height: 46px; }
  .dock-item.magnify-1 { width: 52px; height: 52px; }
  .dock-item.magnify-0 { width: 58px; height: 58px; }

  .dock-label {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 540px) {
  .dock-panel {
    gap: 0.4rem;
    padding: 0.3rem 0.6rem;
  }

  .dock-item {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .dock-item .dock-icon svg {
    width: 16px;
    height: 16px;
  }

  .dock-item.magnify-2 { width: 42px; height: 42px; }
  .dock-item.magnify-1 { width: 48px; height: 48px; }
  .dock-item.magnify-0 { width: 54px; height: 54px; }
}
/* ---------- PillNav 导航 ---------- */
:root {
  --pill-base: #ffffff;
  --pill-bg: #120F17;
  --pill-hover-text: #120F17;
  --pill-text: #ffffff;
  --nav-h: 50px;
  --logo: 42px;
  --pill-pad-x: 20px;
  --pill-gap: 4px;
}

.pill-nav-container {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.pill-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-logo {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--pill-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.pill-logo:hover {
  transform: scale(1.05) rotate(5deg);
}

.pill-logo-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pill-logo-mark {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.pill-nav-items {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  background: var(--pill-base);
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pill-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: var(--pill-gap);
  margin: 0;
  padding: 4px;
  height: 100%;
}

.pill-list > li {
  display: flex;
  height: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 var(--pill-pad-x);
  background: var(--pill-bg);
  color: var(--pill-text);
  text-decoration: none;
  border-radius: 9999px;
  box-sizing: border-box;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-cn);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.pill .hover-circle {
  position: absolute;
  left: 50%;
  bottom: 0;
  border-radius: 50%;
  background: var(--pill-base);
  z-index: 1;
  display: block;
  pointer-events: none;
  will-change: transform;
  transform: scale(0) translateX(-50%);
}

.pill .label-stack {
  position: relative;
  display: inline-block;
  line-height: 1;
  z-index: 2;
}

.pill .pill-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  line-height: 1;
  will-change: transform;
}

.pill .pill-label-hover {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pill-hover-text);
  z-index: 3;
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
}

.pill.is-active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--pill-base);
  border-radius: 50%;
  z-index: 4;
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.6);
}

/* 移动端 */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.mobile-menu-button {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--pill-base);
  border: none;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--pill-bg);
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-popover {
  position: absolute;
  top: calc(var(--nav-h) + 1rem);
  left: 0;
  right: 0;
  background: var(--pill-base);
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform-origin: top center;
  pointer-events: none;
}

.mobile-menu-popover.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-link {
  display: block;
  padding: 14px 20px;
  color: var(--pill-text);
  background-color: var(--pill-bg);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-cn);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link.is-active {
  background-color: var(--accent);
  color: #04120f;
}

@media (max-width: 820px) {
  .pill-nav-container {
    width: calc(100% - 2rem);
    top: 1rem;
  }

  .pill-nav {
    width: 100%;
    justify-content: space-between;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

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

@media (max-width: 540px) {
  .pill-nav-container {
    width: calc(100% - 1.5rem);
  }

  :root {
    --nav-h: 46px;
  }

  .pill-logo-mark {
    font-size: 0.9rem;
  }
}
