/* Theme tokens: minimalist black & white with accent */
:root {
  --bg: #ffffff;
  --text: #0b0c0e;
  --muted: #6b7280;
  --surface: #f6f6f6;
  --line: #e5e7eb;
  --accent: #0b0c0e;
  --primary: #7c2d12;
  --highlight: #991b1b;
}
.dark {
  --bg: #0b0c0e;
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --surface: #121316;
  --line: #22252a;
  --accent: #ffffff;
  --primary: #9f1239;
  --highlight: #831843;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  color: var(--text);
  background: #fafafa;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: 65px; /* 为固定导航栏预留空间 */
}
.dark body {
  background: #0a0a0a;
}
h1, h2, h3, h4 { font-family: "Crimson Text", Georgia, serif; margin: 0 0 8px; letter-spacing: .2px; }
h1 { font-size: 56px; font-weight: 600; }
h2 { font-size: 32px; font-weight: 600; color: var(--text); }
h3 { font-size: 20px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 16px; }
ul { margin: 0 0 16px 20px; }
a { color: inherit; text-decoration: none; }

.muted { color: var(--muted); }

.container { max-width: 1120px; padding: 0 24px; margin: 0 auto; }
.section { padding: 120px 0; border-top: 1px solid var(--line); }
.section-header { margin-bottom: 28px; }

/* Hero */
.hero { 
  padding-top: 32px; 
  position: relative;
  overflow: hidden;
  min-height: 350px;
  padding-bottom: 40px;
  background: var(--bg);
}

.hero-bg-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 0;
  pointer-events: none;
}

.bg-word {
  position: absolute;
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 300;
  font-size: 72px;
  color: rgba(0, 0, 0, 0.08);
  letter-spacing: 4px;
  transform: translateY(0) translateX(0);
  opacity: 0.6;
  filter: blur(0px);
  cursor: default;
  pointer-events: none;
  will-change: opacity, transform;
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.dark .bg-word {
  color: rgba(255, 255, 255, 0.12);
  opacity: 0.7;
}

/* 错落有致的布局 - 确保在导航栏上方 */
.bg-word-1 { top: 12%; left: 8%; font-size: 85px; }
.bg-word-2 { top: 20%; right: 12%; font-size: 95px; }
.bg-word-3 { top: 35%; left: 5%; font-size: 78px; }
.bg-word-4 { top: 45%; right: 8%; font-size: 88px; }
.bg-word-5 { top: 55%; left: 15%; font-size: 82px; }
.bg-word-6 { top: 65%; right: 10%; font-size: 75px; }
.bg-word-7 { top: 28%; left: 50%; font-size: 90px; }
.bg-word-8 { top: 50%; left: 45%; font-size: 80px; }

/* 居中的词特殊处理 */
.bg-word-7 {
  transform: translateX(calc(-50% + 0px));
}

/* 每个词不同的浮动方向和幅度 - 通过data属性在JS中设置 */
.bg-word {
  --float-x: 0px;
  --float-y: 0px;
}

.bg-word.float-animation {
  animation: float-word 8s ease-in-out infinite;
}

/* 每个词不同的浮动方向 */
.bg-word-1 {
  animation: float-1 8s ease-in-out infinite;
  animation-delay: 0s;
}
.bg-word-2 {
  animation: float-2 8s ease-in-out infinite;
  animation-delay: 1s;
}
.bg-word-3 {
  animation: float-3 8s ease-in-out infinite;
  animation-delay: 2s;
}
.bg-word-4 {
  animation: float-4 8s ease-in-out infinite;
  animation-delay: 3s;
}
.bg-word-5 {
  animation: float-5 8s ease-in-out infinite;
  animation-delay: 4s;
}
.bg-word-6 {
  animation: float-6 8s ease-in-out infinite;
  animation-delay: 5s;
}
.bg-word-7 {
  animation: float-7 8s ease-in-out infinite;
  animation-delay: 6s;
}
.bg-word-8 {
  animation: float-8 8s ease-in-out infinite;
  animation-delay: 7s;
}

/* 每个词不同的浮动路径 */
@keyframes float-1 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-6px) translateX(3px); }
  50% { transform: translateY(-3px) translateX(6px); }
  75% { transform: translateY(-9px) translateX(2px); }
}

@keyframes float-2 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(4px) translateX(-5px); }
  50% { transform: translateY(8px) translateX(-2px); }
  75% { transform: translateY(3px) translateX(-7px); }
}

@keyframes float-3 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-7px) translateX(-3px); }
  50% { transform: translateY(-4px) translateX(-6px); }
  75% { transform: translateY(-10px) translateX(-1px); }
}

@keyframes float-4 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(5px) translateX(4px); }
  50% { transform: translateY(9px) translateX(1px); }
  75% { transform: translateY(4px) translateX(8px); }
}

@keyframes float-5 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-5px) translateX(5px); }
  50% { transform: translateY(-8px) translateX(3px); }
  75% { transform: translateY(-2px) translateX(7px); }
}

@keyframes float-6 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(6px) translateX(-4px); }
  50% { transform: translateY(10px) translateX(-1px); }
  75% { transform: translateY(5px) translateX(-8px); }
}

@keyframes float-7 {
  0%, 100% { transform: translateX(calc(-50% + 0px)) translateY(0); }
  25% { transform: translateX(calc(-50% + 4px)) translateY(-5px); }
  50% { transform: translateX(calc(-50% + -3px)) translateY(-8px); }
  75% { transform: translateX(calc(-50% + 2px)) translateY(-4px); }
}

@keyframes float-8 {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-4px) translateX(-6px); }
  50% { transform: translateY(-7px) translateX(-2px); }
  75% { transform: translateY(-1px) translateX(-9px); }
}

.hero-inner { 
  padding: 40px 0 24px; 
  text-align: center; 
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.site-name { font-size: 64px; }
.site-subtitle { color: var(--muted); font-size: 16px; letter-spacing: .5px; text-transform: uppercase; }
.tagline { 
  margin-top: 12px; 
  font-size: 18px; 
  cursor: pointer; 
  display: inline-block; 
  border-bottom: 1px dotted var(--muted); 
  position: relative;
  z-index: 20;
  pointer-events: auto;
}

/* Nav */
.nav { 
  position: fixed; 
  top: 0; 
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000; 
  background: rgba(255, 255, 255, 0.95); 
  border-top: 1px solid var(--line); 
  border-bottom: 1px solid var(--line); 
  backdrop-filter: saturate(140%) blur(12px);
  transition: all 0.3s ease;
}
.dark .nav {
  background: rgba(11, 12, 14, 0.95);
}

/* 为固定导航栏添加body顶部间距 */
.nav-inner { display: flex; align-items: center; justify-content: center; height: 64px; }
.nav-list { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.nav a { 
  color: var(--text); 
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}
.nav a:hover {
  background: var(--surface);
  color: var(--primary);
}
.nav a.active {
  color: var(--primary);
  font-weight: 500;
}
.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}
.brand { font-family: "Ibarra Real Nova", Georgia, serif; font-weight: 600; }
.nav.scrolled { 
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  background: rgba(255, 255, 255, 0.98);
}
.dark .nav.scrolled {
  background: rgba(11, 12, 14, 0.98);
}

/* Grids */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (min-width: 1200px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 32px; } }

/* About */
.about-grid { align-items: center; }
.about-media { display: flex; justify-content: center; }
.portrait { width: 280px; height: 280px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); background: var(--surface); }
/* Education Section */
.education-section { margin-top: 24px; }
.education-item { 
  margin-bottom: 16px; 
  padding: 16px 20px; 
  border: 1px solid var(--line); 
  border-radius: 8px; 
  background: var(--surface);
}
.education-item:last-child { margin-bottom: 0; }
.education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.education-main {
  flex: 1;
}
.education-item h4 { 
  font-size: 18px; 
  color: var(--text); 
  margin-bottom: 4px; 
  font-weight: 600;
}
.education-item .location { 
  color: var(--muted); 
  font-size: 13px; 
  margin-bottom: 6px; 
  font-style: italic;
}
.education-item .degree { 
  font-size: 15px; 
  color: var(--text); 
  margin-bottom: 0; 
  font-weight: 500;
}
.education-item .duration { 
  color: var(--muted); 
  font-size: 13px; 
  text-align: right;
  white-space: nowrap;
  margin-left: 16px;
  margin-bottom: 0;
}
.education-item .achievement { 
  color: var(--highlight); 
  font-size: 13px; 
  font-weight: 500; 
  margin-bottom: 0;
}
.frame { border: 1px solid var(--line); background: var(--surface); }
.actions { margin-top: 10px; }

/* Cards */
.card { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 20px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 6px; }

/* Work Experience */
.work-section, .research-section { margin-bottom: 48px; }
.section-subtitle { font-size: 24px; color: var(--text); margin-bottom: 24px; }
.work-grid { display: grid; gap: 32px; }
.work-card { display: grid; grid-template-columns: 1fr; gap: 20px; border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--surface); }
.work-card.featured { border-color: var(--highlight); box-shadow: 0 2px 8px rgba(153, 27, 27, 0.08); }
.work-visual img { width: 100%; height: auto; border-radius: 8px; }
.achievements { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.badge { background: var(--highlight); color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }

/* Research Projects */
.research-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.research-card { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); }
.research-visual img { width: 100%; height: auto; border-radius: 8px; }

@media (min-width: 900px) {
  .work-card { grid-template-columns: 1fr 300px; align-items: center; }
  .research-grid { grid-template-columns: 1fr 1fr; }
  .research-card { grid-template-columns: 1fr; }
  .research-visual { order: -1; }
}

/* Buttons */
.btn { display: inline-block; border: 1px solid var(--highlight); color: var(--highlight); padding: 10px 16px; border-radius: 999px; font-weight: 500; }
.btn:hover { background: var(--highlight); color: white; }

/* Portfolio Showcase */
.portfolio-showcase { position: relative; }
.portfolio-nav { position: absolute; top: 50%; z-index: 10; width: 100%; display: flex; justify-content: space-between; pointer-events: none; }
.nav-btn { pointer-events: all; background: rgba(0,0,0,0.7); color: white; border: none; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.nav-btn:hover { background: rgba(0,0,0,0.9); }

.portfolio-slider { 
  overflow: hidden; 
  border-radius: 16px; 
  position: relative;
  min-height: 800px; /* 固定最小高度 */
}
.portfolio-slide { 
  display: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
.portfolio-slide.active { 
  display: block; 
  opacity: 1;
  position: relative;
}
.portfolio-hero img { 
  width: 100%; 
  height: 500px; 
  object-fit: cover; 
  display: block;
}
.portfolio-details { padding: 32px; background: var(--surface); border: 1px solid var(--line); border-top: none; }
.portfolio-details h3 { color: var(--text); margin-bottom: 4px; }
.portfolio-details h4 { color: var(--text); margin-bottom: 8px; }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { background: var(--line); color: var(--text); padding: 4px 12px; border-radius: 16px; font-size: 13px; }

.portfolio-indicators { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.indicator { 
  width: 12px; 
  height: 12px; 
  border-radius: 50%; 
  border: 2px solid var(--line); 
  background: transparent; 
  cursor: pointer; 
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.indicator.active { 
  background: var(--highlight); 
  border-color: var(--highlight); 
}
.indicator:hover {
  border-color: var(--highlight);
  transform: scale(1.1);
}

/* Leadership */
.leadership-content { display: grid; grid-template-columns: 1fr; gap: 32px; }
.leadership-images { display: grid; grid-template-columns: 1fr; gap: 20px; }
.leadership-img { text-align: center; }
.leadership-img img { width: 100%; height: auto; border-radius: 12px; max-width: 650px; min-height: 200px; object-fit: cover; }
.leadership-img figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

@media (min-width: 900px) {
  .leadership-content { grid-template-columns: 1.5fr 1fr; }
  .leadership-images { grid-template-columns: 1fr; }
}

/* CV */
.cv-embed { 
  border: 1px solid var(--line); 
  border-radius: 12px; 
  overflow: hidden; 
  background: var(--surface); 
  text-align: center;
}
.cv-image {
  width: 100%;
  height: auto;
  display: block;
  max-width: 700px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 0.2s ease;
}

/* Blog */
.blog-list { display: grid; gap: 24px; }
.blog-item { border: 1px solid var(--line); border-radius: 12px; padding: 24px; background: var(--surface); }
.blog-item.clickable { cursor: pointer; transition: all 0.2s ease; }
.blog-item.clickable:hover { border-color: var(--highlight); box-shadow: 0 2px 8px rgba(153, 27, 27, 0.08); }
.blog-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* Modal */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
.modal-content { background: var(--bg); margin: 5% auto; padding: 32px; width: 90%; max-width: 800px; border-radius: 16px; position: relative; max-height: 80vh; overflow-y: auto; }
.close { position: absolute; right: 20px; top: 20px; font-size: 28px; font-weight: bold; cursor: pointer; color: var(--muted); }
.close:hover { color: var(--text); }

/* Contact */
.contact-list { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 8px; }
.contact-item { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; color: var(--text); background: var(--surface); }
.contact-item:hover { border-color: var(--accent); }
.quote { margin-top: 16px; color: var(--muted); font-style: italic; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.to-top { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }


