/* 
   Modern Academic Theme for Maggie's Personal Site
   Refined, elegant, and professional.
*/

:root {
  /* Color Palette - Sophisticated Slate & Forest Green */
  --bg-body: #fdfdfd;
  --bg-card: #ffffff;
  --text-main: #1a202c;
  --text-muted: #4a5568;
  --primary: #2d5a43; /* Forest Green - sophisticated and academic */
  --primary-light: #4d7c5e;
  --primary-dark: #1e3d2d;
  --accent: #d97706; /* Amber for highlights */
  --border: #edf2f7;
  --radius: 16px;
  --max-width: 1000px;
  
  /* Fonts */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', serif;
  
  /* Spacing */
  --section-spacing: 100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Navigation --- */
nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1.25rem 0;
}

nav .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.03em;
  font-family: var(--serif);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* --- Hero Section --- */
.hero {
  padding: 100px 0 60px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-family: var(--serif);
  font-size: 3.75rem;
  line-height: 1.1;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.hero-text .subtitle {
  font-size: 1.5rem;
  color: var(--primary-light);
  font-weight: 500;
  margin-bottom: 2rem;
  font-family: var(--sans);
}

.hero-text .bio {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-text .bio p {
  margin-bottom: 1.25rem;
}

.hero-text .bio strong {
  color: var(--text-main);
  font-weight: 600;
}

/* Social Links */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.social-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.04);
}

/* Avatar Wrapper */
.avatar-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%; /* 圆形头像 */
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
  border: 4px solid #fff;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.avatar-wrapper img.active {
  opacity: 1;
}

/* --- Section Titles --- */
.section-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 2rem;
}

.section-title .view-all {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-left: 1.5rem;
}

/* --- Publications --- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-item {
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.pub-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
  border-color: var(--primary-light);
}

.pub-item.highlight {
  background: linear-gradient(to right, rgba(45, 90, 67, 0.02), transparent);
}

.pub-item.highlight::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--primary);
}

.pub-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  line-height: 1.4;
}

.pub-authors {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pub-authors strong {
  color: var(--text-main);
  text-decoration: underline decoration-color(var(--primary-light)) 2px;
  text-underline-offset: 3px;
}

.pub-venue {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-oral {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pub-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.pub-links a {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--border);
  border-radius: 8px;
  color: var(--text-main);
}

.pub-links a:hover {
  background: var(--primary);
  color: #fff;
}

/* --- Footer --- */
footer {
  padding: 80px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  margin-top: 100px;
}

footer p {
  margin-top: 10px;
  opacity: 0.8;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  
  .avatar-wrapper {
    margin: 0 auto;
    width: 220px;
    height: 220px;
    order: -1;
  }
  
  .hero-text h1 {
    font-size: 2.75rem;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .section-title::after {
    display: none;
  }

  .pub-item {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .nav-links {
    gap: 1.5rem;
  }
  
  .hero-text h1 {
    font-size: 2.25rem;
  }
  
  .nav-logo {
    font-size: 1.1rem;
  }
}
