/* ============================================================
   个人主页 · 共享样式（极简黑白，与「故事」页统一）
   ============================================================ */

:root {
  --bg: #08080a;
  --ink: #f5f5f6;
  --ink-soft: rgba(245, 245, 246, 0.55);
  --line: rgba(245, 245, 246, 0.14);

  --serif: Georgia, "Times New Roman", "Noto Serif SC", "Source Han Serif SC",
    "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.85;
  overflow-x: hidden;
}

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

/* ============ 顶部导航 ============ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.8rem 0.9rem;
}

.site-nav__brand {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.26em;
}

.site-nav__links { display: flex; gap: 1.4rem; }

.site-nav__links a {
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 0.3rem;
  transition: color 0.3s ease;
}

.site-nav__links a:hover { color: var(--ink); }

.site-nav__links a.active { color: var(--ink); }
.site-nav__links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
}

/* ============ 首页（落地页） ============ */
.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.home__name {
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.1;
}

.home__tagline {
  margin-top: 1.8rem;
  font-size: 1rem;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

.home__menu {
  margin-top: 4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.home__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.3rem 1.9rem;
  min-width: 7.2rem;
  border: 1px solid var(--line);
  transition: border-color 0.35s ease, background 0.35s ease;
}

.home__item:hover { border-color: var(--ink); background: rgba(255, 255, 255, 0.03); }

.home__item span { font-size: 1.08rem; letter-spacing: 0.22em; margin-left: 0.22em; }

.home__item em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  margin-left: 0.3em;
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

/* ============ 内容页通用 ============ */
.page {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 46rem;
  margin: 0 auto;
  padding: calc(5.5rem + env(safe-area-inset-top, 0px)) 1.8rem 4rem;
}

.page__label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.page__title {
  margin-top: 1rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  margin-left: 0.18em;
  line-height: 1.1;
}

.page__body {
  margin-top: 2.6rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

.page__body p { margin: 1.1rem 0; }

.page__body .lead { color: var(--ink); font-size: 1.12rem; }

.page__body h2 {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0.32em;
  color: var(--ink);
  margin: 2.6rem 0 0.9rem;
  text-transform: uppercase;
}

.page__body ul { list-style: none; }
.page__body li { padding: 0.45rem 0; }

.page__body a {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-soft);
}
.page__body a:hover { text-decoration-color: var(--ink); }

.note {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  opacity: 0.5;
  margin-top: 1rem;
}

/* ============ demo 卡片页（叠放展示板） ============ */
.demo-page {
  max-width: none;
  padding: 0;
}

.demo-cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 1.5rem 6rem;
}

.demo-cover__hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  color: var(--ink-soft);
}

.demo-cover__line {
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(to bottom, transparent, currentColor);
  opacity: 0.6;
}

.demo-stage-wrap {
  height: 160vh; /* 2 张卡 → 约 60vh 滚动完成一次切换 */
}

.demo-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

.demo-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.85), transparent 24%);
  pointer-events: none;
}

.demo-card {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(5rem + env(safe-area-inset-top, 0px)) clamp(1rem, 4vw, 4rem) 4.5rem;
  will-change: transform, filter;
  pointer-events: none;
}

.demo-card.is-active { pointer-events: auto; }

.demo-card__video {
  position: relative;
  display: block;
  width: min(94vw, 980px);
  aspect-ratio: 16 / 9;
}

.demo-card__video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transition: border-color 0.35s ease;
}

.demo-card.is-active .demo-card__video video:hover { border-color: var(--ink); }

.demo-card__enter {
  position: absolute;
  right: 0.9rem;
  bottom: 0.8rem;
  padding: 0.32rem 0.72rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.demo-card.is-active:hover .demo-card__enter { opacity: 1; }

/* 底部滚动提示 */
.demo-hint {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 50;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* ============ demo 详情页 ============ */
.demo-detail { max-width: 1080px; }

.demo-detail__player {
  margin-top: 2.6rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.demo-detail__player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.demo-detail__body {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.demo-detail__body .lead { color: var(--ink); font-size: 1.12rem; }

.demo-detail__figure {
  margin-top: 2.6rem;
}

.demo-detail__figure img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
}

.demo-detail__figure figcaption {
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.demo-detail__back {
  display: inline-block;
  margin-top: 3rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  transition: color 0.3s ease;
}

.demo-detail__back:hover { color: var(--ink); }

/* ============ 诗 ============ */
.poems { margin-top: 2.6rem; }

.poem {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
}

.poem:first-of-type { border-top: 1px solid var(--line); }

.poem h2 {
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  margin-left: 0.24em;
  color: var(--ink);
  margin-bottom: 1.1rem;
}

.poem p {
  color: var(--ink-soft);
  line-height: 2.2;
  letter-spacing: 0.06em;
}

.poem p + p { margin-top: 1.6rem; }

/* ============ 论文列表 ============ */
.pubs { list-style: none; }

.pub {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.pub__title {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.pub__authors {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.pub__meta {
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.pub__links { margin-top: 0.55rem; }

.pub__links a {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  margin-right: 1rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--ink-soft);
}

.pub__links a:hover { text-decoration-color: var(--ink); }

/* ============ 微电影 ============ */
.page--film { text-align: center; }

.film {
  margin-top: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.film__player {
  max-width: min(88vw, 1000px);
  max-height: 68vh;
  max-height: 68svh;
  width: auto;
  height: auto;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.film__title {
  margin-top: 0.8rem;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  margin-left: 0.24em;
  color: var(--ink);
}

.film__caption {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.9;
}

.film__meta {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  opacity: 0.7;
}

/* ============ 首页封面 ============ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.hero__name {
  font-size: clamp(3rem, 13vw, 7.5rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

.hero__scroll {
  position: absolute;
  bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink-soft);
}

.hero__scroll-line {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, currentColor);
  opacity: 0.6;
  animation: heroNudge 2.2s ease-in-out infinite;
}

.hero__scroll-text {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  margin-left: 0.4em;
}

@keyframes heroNudge {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.25; }
}

/* 顶部导航：首页下滑后出现（封面文字"拼接"到上方） */
.site-nav--home {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  background: rgba(8, 8, 10, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-nav--home.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============ 自我介绍 ============ */
.about {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: calc(4rem + env(safe-area-inset-top, 0px)) 5vw 3rem;
}

.about__photo {
  flex: 0 0 34%;
  min-width: 220px;
}

.about__photo-box {
  aspect-ratio: 3 / 4;
  border: 1px dashed rgba(245, 245, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  margin-left: 0.4em;
  background: rgba(255, 255, 255, 0.02);
}

.about__body {
  flex: 1 1 auto;
}

.about__title {
  margin-top: 1rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.about__text {
  margin-top: 1.4rem;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ============ 学术成果（首页区块） ============ */
.academic {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 46rem;
  margin: 0 auto;
  padding: calc(4rem + env(safe-area-inset-top, 0px)) 1.8rem 4rem;
}

/* ============ 页脚 ============ */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1.7rem 1.5rem calc(1.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .site-nav { padding: 0.9rem 1.1rem 0.7rem; }
  .site-nav__links { gap: 1rem; }
  .site-nav__links a { font-size: 0.78rem; letter-spacing: 0.1em; }

  .page { padding-left: 1.4rem; padding-right: 1.4rem; }
  .home__menu { gap: 0.6rem; }
  .home__item { padding: 1rem 1.3rem; min-width: 6.2rem; }

  .about { flex-direction: column; gap: 2.4rem; padding-top: 3rem; }
  .about__photo { flex: none; width: min(70vw, 260px); margin: 0 auto; }
  .about__body { text-align: center; }

  .demo-card { padding-top: 4.5rem; }
  .demo-stage-wrap { height: 150vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
