@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;700&display=swap');

:root {
  /* 基础与点缀色 (青绿 + 暖金升级) */
  --bg-color: #f6f3eb;
  --bg-gradient-1: #e4efe9;
  --bg-gradient-2: #faeed7;
  --primary: #1f6b5f;
  --primary-deep: #123d37;
  --accent: #c47a43;
  --accent-light: rgba(196, 122, 67, 0.15);
  
  /* 文本颜色 */
  --text: #1a2222;
  --muted: #5b6766;
  --light-text: #8b9594;
  
  /* 玻璃拟态卡片 */
  --panel: rgba(255, 255, 255, 0.65);
  --panel-border: rgba(255, 255, 255, 0.85);
  --panel-shadow: 0 16px 40px rgba(31, 107, 95, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --panel-hover-shadow: 0 24px 60px rgba(31, 107, 95, 0.12), inset 0 1px 0 rgba(255, 255, 255, 1);
  --line: rgba(31, 107, 95, 0.1);
  
  /* 圆角参数 */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-color);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
}

/* 动态流溢背景 Blob */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-color), #f9f7f4);
}
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  animation: float 20s infinite alternate ease-in-out;
}
.blob-1 {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--bg-gradient-1), transparent 70%);
  animation-duration: 25s;
}
.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, var(--bg-gradient-2), transparent 70%);
  animation-duration: 22s;
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.05); }
  100% { transform: translate(-5%, -5%) scale(0.95); }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary-deep);
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 60px;
}

/* 顶部导航 */
.topbar {
  position: sticky;
  top: 24px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  margin-bottom: 40px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--panel-shadow);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.topbar:hover {
  box-shadow: 0 16px 40px rgba(31, 107, 95, 0.1);
  border-color: rgba(255,255,255,1);
}

.brand {
  font-family: "Noto Serif SC", serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-deep);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a {
  color: var(--text);
  position: relative;
  padding-bottom: 4px;
}

.nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav a:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 40px;
  padding: 48px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--panel-shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -5% -20% auto;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 122, 67, 0.15), transparent 70%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(31, 107, 95, 0.08);
  border: 1px solid rgba(31, 107, 95, 0.15);
  color: var(--primary-deep);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1, h2, h3 {
  color: var(--text);
  line-height: 1.3;
}

.hero h1 {
  margin-top: 24px;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(3rem, 5vw, 5rem);
  letter-spacing: 0.02em;
  color: var(--primary-deep);
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

.button,
.link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(8px);
}

.button {
  background: var(--primary);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 20px rgba(31, 107, 95, 0.25);
}

.button:hover {
  background: var(--primary-deep);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(31, 107, 95, 0.35);
}

.link-pill {
  border: 1px solid rgba(31, 107, 95, 0.2);
  background: rgba(255, 255, 255, 0.5);
  color: var(--primary-deep);
}

.link-pill:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.hero-meta {
  display: grid;
  gap: 20px;
  align-content: start;
}

/* 通用卡片样式 (玻璃拟态) */
.portrait-card,
.card,
.project,
.paper,
.mini-card,
.essay-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover,
.project:hover,
.paper:hover,
.essay-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--panel-hover-shadow);
  background: rgba(255, 255, 255, 0.85);
}

.portrait-card {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-xl);
}

.portrait-card img {
  width: min(240px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 24px 48px rgba(31, 107, 95, 0.2);
  border: 4px solid #fff;
  transition: transform 0.5s ease;
}

.portrait-card:hover img {
  transform: scale(1.03) rotate(2deg);
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.mini-card {
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
  border-radius: var(--radius-md);
}

.mini-card strong {
  display: block;
  font-size: 1.8rem;
  font-family: 'Inter', sans-serif;
  color: var(--primary-deep);
  line-height: 1.2;
}

.mini-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  display: block;
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.section {
  margin-top: 60px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}

.section-header p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 640px;
  font-size: 1.05rem;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-family: "Noto Serif SC", serif;
  color: var(--primary-deep);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.two-column {
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
}

.two-column .card {
  height: 100%;
}

.card {
  padding: 36px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 24px;
}

.timeline li {
  position: relative;
  padding-left: 28px;
  color: var(--muted);
  font-size: 1.05rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(196, 122, 67, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline li:hover::before {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(196, 122, 67, 0.25);
}

.news-list {
  display: grid;
  gap: 16px;
}

.news-item {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.3s ease;
}

.news-item:hover {
  background: rgba(255, 255, 255, 0.85);
}

.news-date {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
}

.project-grid,
.paper-grid,
.simple-grid,
.essay-grid {
  display: grid;
  gap: 24px;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.paper-grid {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.simple-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.essay-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.project,
.paper,
.essay-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.project h3,
.paper h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--primary-deep);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.project ul,
.list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.project ul li,
.list li {
  margin-bottom: 8px;
}

.project ul li::marker,
.list li::marker {
  color: var(--primary);
}

.essay-card h3 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-deep);
}

.essay-card p {
  margin: auto 0 0; /* Pushes links to bottom */
  font-size: 0.9rem;
  color: var(--light-text);
  word-break: break-all;
}

.paper-top {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}

.paper img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid var(--line);
  transition: transform 0.3s ease;
}

.paper:hover img {
  transform: scale(1.05);
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.paper .muted {
  margin-bottom: 6px;
}

.paper .muted u {
  font-weight: 600;
  text-decoration-color: var(--primary);
  text-underline-offset: 4px;
}

.paper a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.paper a::after {
  content: '→';
  transition: transform 0.2s;
}
.paper:hover a::after {
  transform: translateX(4px);
}

@media (max-width: 1040px) {
  .hero,
  .two-column {
    grid-template-columns: 1fr;
  }
  .hero-meta {
    order: -1;
  }
}

@media (max-width: 720px) {
  .shell {
    width:calc(100% - 32px);
    padding-top: 16px;
  }

  .topbar {
    border-radius: var(--radius-lg);
    flex-direction: column;
    padding: 16px;
  }
  
  .nav {
    justify-content: center;
  }

  .hero,
  .card,
  .project,
  .paper,
  .portrait-card,
  .essay-card {
    padding: 24px;
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .paper-top {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 2.2rem;
  }
}

/* 滚动入场视差动画 (配合 JS) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance for grids */
.grid-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.grid-stagger > *:nth-child(2) { transition-delay: 0.15s; }
.grid-stagger > *:nth-child(3) { transition-delay: 0.25s; }
.grid-stagger > *:nth-child(4) { transition-delay: 0.35s; }
.grid-stagger > *:nth-child(5) { transition-delay: 0.45s; }
.grid-stagger > *:nth-child(6) { transition-delay: 0.55s; }
