/* ============================================================
   Apple-style Academic Personal Site
   Design tokens inspired by apple.com: large type, generous
   whitespace, SF-like typography, subtle gradients, soft shadows.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --line: #d2d2d7;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
}

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

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

/* ===================== Navigation ===================== */
.nav {
  position: fixed;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 980px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.08);
}
.nav-inner {
  padding: 0 8px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* 胶囊式 tab 容器 */
.nav-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
}
.nav-brand {
  display: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.nav-tab {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.45);
  padding: 7px 18px;
  border-radius: 980px;
  transition: color 0.25s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.nav-tab:hover { color: rgba(0, 0, 0, 0.8); }
.nav-tab.active { color: #1d1d1f; font-weight: 600; }
.nav-indicator {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  background: rgba(0, 0, 0, 0.07);
  border-radius: 980px;
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
  will-change: transform, width;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  position: absolute;
  right: 16px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: #000;
  border-radius: 2px;
  transition: 0.3s var(--ease);
}
.nav-toggle.active span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle.active span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.nav-mobile {
  display: none;
  flex-direction: column;
  background: rgba(28, 28, 30, 0.96);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  margin-top: 8px;
  overflow: hidden;
}
.nav-mobile a {
  padding: 14px 24px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile.open { display: flex; }

/* ===================== Hero ===================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 130px 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,113,227,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(142,107,242,0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(255,126,95,0.06), transparent 60%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}
.hero-eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #1d1d1f 0%, #43434a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.hero-desc {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.65;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 26px;
  border-radius: 980px;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.03); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: rgba(0,113,227,0.06); }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--ink-faint);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.scroll-hint span {
  width: 3px; height: 8px;
  background: var(--ink-faint);
  border-radius: 2px;
  animation: scrollPulse 1.6s infinite var(--ease);
}
@keyframes scrollPulse {
  0% { opacity: 0; transform: translateY(-4px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(8px); }
}

/* ===================== Sections ===================== */
.section { padding: 112px 0; }
.section-alt { background: var(--bg-alt); }
.section-first { padding-top: 132px; }
.section-head { max-width: 680px; margin-bottom: 48px; }
.section-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.section-title-center { text-align: center; }
.section-lead {
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 640px;
}
.section-lead-center { text-align: center; max-width: 520px; margin: 0 auto; }

/* ===================== News / Timeline ===================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 32px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: 1px solid var(--line); }
.timeline-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
}
.timeline-body h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.35;
}
.timeline-body p { color: var(--ink-soft); font-size: 16px; }
.timeline-body em { font-style: italic; color: var(--ink); }
.timeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(0, 113, 227, 0.13);
  border-radius: 9px;
  background: rgba(0, 113, 227, 0.07);
  font-size: 15px;
}
.timeline-note {
  display: block;
  margin-top: 8px;
  color: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ===================== Publications ===================== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.filter-chip {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 980px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.pub-list { display: flex; flex-direction: column; gap: 32px; }
.pub-card {
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.pub-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.09);
}
.pub-figure {
  margin: 0;
  padding: 26px 30px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.pub-image {
  width: 100%;
  height: auto;
  max-height: 310px;
  object-fit: contain;
}
.pub-info {
  padding: 32px 36px 36px;
  background: var(--bg-alt);
}
.pub-meta-line {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pub-meta-line span { margin: 0 5px; color: var(--ink-faint); }
.pub-title {
  max-width: 860px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 650;
  line-height: 1.22;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}
.pub-authors {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.pub-authors strong { color: var(--ink); font-weight: 650; }
.pub-citation {
  font-size: 14px;
  color: var(--ink-faint);
  line-height: 1.6;
  margin-bottom: 20px;
}
.pub-citation a { color: var(--accent); white-space: nowrap; }
.pub-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.pub-action,
.bibtex-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.pub-action:hover,
.bibtex-details summary:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 113, 227, 0.5);
  background: rgba(0, 113, 227, 0.04);
}
.pub-action-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.pub-action-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.bibtex-details summary {
  list-style: none;
  user-select: none;
}
.bibtex-details summary::-webkit-details-marker { display: none; }
.bibtex-details[open] { flex: 1 0 100%; }
.bibtex-details[open] summary { margin-bottom: 12px; }
.bibtex-details pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: #f5f5f7;
  color: #343438;
  font: 13px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

/* ===================== Honors & Awards ===================== */
.honors-list {
  display: flex;
  flex-direction: column;
}
.honor-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.honor-item:last-child { border-bottom: 1px solid var(--line); }
.honor-year {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.honor-body h3 {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
}
.honor-body p { color: var(--ink-soft); font-size: 15px; }

/* ===================== Blog ===================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.blog-cover {
  height: 180px;
  background: var(--g, linear-gradient(135deg,#667eea,#764ba2));
}
.blog-body { padding: 24px; }
.blog-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-faint);
  letter-spacing: 0.3px;
}
.blog-body h3 {
  font-size: 21px;
  font-weight: 600;
  margin: 8px 0 10px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.blog-body p {
  font-size: 15px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.6;
}
.blog-read {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* ===================== About ===================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.46fr);
  grid-template-areas:
    "intro photo"
    "copy photo";
  column-gap: clamp(40px, 6vw, 72px);
  row-gap: 0;
  align-items: start;
}
.about-intro {
  grid-area: intro;
  min-width: 0;
}
.about-copy {
  grid-area: copy;
  min-width: 0;
  max-width: 66ch;
}
.about-photo {
  grid-area: photo;
  position: static;
  align-self: start;
  padding-top: 48px;
}
.about-name {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 8px 0 10px;
  color: var(--ink);
}
.about-role {
  font-size: 19px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}
.about-bio {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  line-height: 1.75;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 28px;
}
.about-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 980px;
}
.about-stats {
  list-style: none;
  display: flex;
  gap: 44px;
  margin: 0 0 32px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about-stats li { display: flex; flex-direction: column; }
.about-stats strong {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}
.about-stats span { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.2px; }
.about-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.about-social {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.about-social a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s;
}
.about-social a:hover { color: var(--accent); }
.photo-frame {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
  justify-self: end;
}
.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
  color: rgba(0,0,0,0.18);
  background: linear-gradient(135deg, #e8e8ed 0%, #f5f5f7 50%, #eceaf2 100%);
  letter-spacing: 2px;
}

/* ===================== Contact ===================== */
.contact-section {
  padding: 148px 0;
  background: #fff;
  color: var(--ink);
}
.contact-inner {
  text-align: center;
  max-width: 620px;
}
.contact-section .section-kicker { color: var(--accent); }
.contact-section .section-lead { color: var(--ink-soft); }
.social-links {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.social-links a:hover {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.45);
  background: rgba(0, 113, 227, 0.04);
  transform: translateY(-1px);
}

/* ===================== Footer ===================== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-faint);
  flex-wrap: wrap;
  gap: 8px;
}

/* ===================== Reveal animation ===================== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== Responsive ===================== */
/* 宽屏 About 保留杂志式两端对齐，其他英文内容保持自然左对齐。 */
@media (min-width: 821px) {
  .about-bio {
    text-align: justify;
    text-justify: inter-word;
    -webkit-hyphens: auto;
    hyphens: auto;
  }
}

@media (max-width: 820px) {
  .nav-tabs { display: none; }
  .nav-brand {
    display: inline-flex;
    position: absolute;
    left: 16px;
  }
  .nav-toggle { display: flex; }
  .nav-inner { justify-content: center; padding: 0 12px; }
  .nav { top: 8px; left: 12px; right: 12px; transform: none; width: auto; }
  .section { padding: 88px 0; }
  .contact-section { padding: 112px 0; }
  .pub-figure { padding: 22px 20px 14px; }
  .pub-info { padding: 26px 24px 28px; }
  .pub-title { font-size: 25px; }
  .pub-citation a { white-space: normal; }
  .blog-grid { grid-template-columns: 1fr; }
  .about-stats { gap: 28px; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .honor-item { grid-template-columns: 1fr; gap: 6px; }
  .about-stats { gap: 28px; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "photo"
      "copy";
    column-gap: 0;
    row-gap: 28px;
  }
  .about-role { margin-bottom: 0; }
  .about-photo {
    position: static;
    padding-top: 0;
  }
  .about-copy { max-width: none; }
  .about-bio {
    text-align: left;
    -webkit-hyphens: none;
    hyphens: none;
  }
  .photo-frame { max-width: 170px; margin: 0 auto; justify-self: center; }
}

@media (max-width: 520px) {
  .pub-figure { padding: 16px 12px 12px; }
  .pub-info { padding: 24px 20px; }
  .pub-action,
  .bibtex-details,
  .bibtex-details summary { width: 100%; }
  .bibtex-details pre { font-size: 12px; padding: 16px; }
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
