:root {
  --bg: #f8fafc;
  --text: #222;
  --accent: #004b6b;
  --panel: #fff;
  --link: #0074a8;
  --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --bg: #1c1f26;
  --text: #ddd;
  --accent: #8ad2ff;
  --panel: #2a2f38;
  --link: #7fc7ff;
  --shadow: rgba(255,255,255,0.1);
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}



/* ===== Navigation ===== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent);
  color: white;
  padding: 12px 30px;
  box-shadow: 0 2px 8px var(--shadow);
}

nav a {
  color: white;
  margin: 0 15px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

nav a:hover {
  opacity: 0.7;
}

/* ===== Page Layout ===== */
.page-content {
  max-width: 1000px;
  margin: 60px auto;
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 4px 15px var(--shadow);
  padding: 50px;
}

h1, h2, h3 {
  color: var(--accent);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 25px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 3px 6px var(--shadow);
}
.theme-toggle:hover {
  background: var(--link);
}

/* ===== Research Grid (Image Cards) ===== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.research-card {
  position: relative;
  height: 280px;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 15px var(--shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.research-card:nth-child(1) { animation-delay: 0.2s; }
.research-card:nth-child(2) { animation-delay: 0.4s; }
.research-card:nth-child(3) { animation-delay: 0.6s; }

.research-card:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 25px var(--shadow);
}

.research-card .overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  color: white;
  padding: 25px;
  opacity: 0;
  transition: opacity 0.5s ease 0.2s;
}

.research-card:hover .overlay {
  opacity: 1;
}

.research-card h2 {
  margin: 0 0 10px;
  font-size: 1.3em;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.research-card p {
  font-size: 0.95em;
  line-height: 1.5;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Research Timeline ===== */
.timeline {
  position: relative;
  margin: 60px auto;
  padding-left: 30px;
  max-width: 800px;
  border-left: 3px solid var(--accent);
}

.timeline-item {
  position: relative;
  margin: 30px 0;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 0.8s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }
.timeline-item:nth-child(4) { animation-delay: 0.8s; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-content {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 10px var(--shadow);
  padding: 20px 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--shadow);
}

.timeline-content h3 {
  color: var(--accent);
  margin-top: 0;
}

.timeline-content h4 {
  margin: 5px 0 10px;
  font-size: 1.1em;
}

/* Mobile */
@media (max-width: 768px) {
  .timeline {
    padding-left: 20px;
  }
  .timeline-content {
    padding: 15px 20px;
  }
  .research-card {
    height: 220px;
  }
}


/* ===== Profile Layout (Home Page) ===== */
.profile-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.profile-left {
  flex: 0 0 180px;
  text-align: center;
}

.profile-right {
  max-width: 500px;
}

.profile-right h1 {
  margin: 0;
  font-size: 2em;
  color: var(--accent);
}

.profile-right h3 {
  margin: 8px 0;
  font-weight: 500;
}

.profile-right p {
  margin: 5px 0;
  font-size: 1.05em;
}

.profile-pic {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 20%;
  box-shadow: 0 6px 15px var(--shadow);
  border: 3px solid var(--accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-pic:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px var(--shadow);
}

/* ===== Bottom Grid (About + News) ===== */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

.about-box, .news-box {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 25px 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-box:hover, .news-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px var(--shadow);
}

.news-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.news-date {
  font-weight: bold;
  color: var(--accent);
  margin-right: 10px;
  flex-shrink: 0;
  width: 80px;
}

.news-content {
  flex: 1;
}

@media (max-width: 900px) {
  .bottom-grid {
    grid-template-columns: 1fr;
  }
  .about-box, .news-box {
    padding: 20px;
  }
}


/* ===== Read More Link Styling ===== */
.read-more {
  margin-top: 20px;
  font-size: 1.05em;
}

.read-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  position: relative;
}

/* 箭头动画 */
.read-more a::after {
  content: "→";
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.8;
}

.read-more a:hover {
  color: var(--link);
  text-shadow: 0 0 8px var(--shadow);
}

.read-more a:hover::after {
  transform: translateX(5px);
  opacity: 1;
}

/* 对齐左右 */
.bottom-grid .about-box .read-more {
  text-align: left;
}
.bottom-grid .news-box .read-more {
  text-align: left;
}



/* Responsive (mobile) */
@media (max-width: 768px) {
  .profile-container {
    flex-direction: column;
    text-align: center;
  }
  .profile-right {
    max-width: 90%;
  }
}


/* ===== Elegant Footer (customized) ===== */
footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
  padding: 25px 0 20px 0;
  margin-top: 60px;
  font-size: 0.95em;
  color: rgba(0, 0, 0, 0.65);
  letter-spacing: 0.3px;
  font-style: italic;
  transition: color 0.3s ease;
}

footer p {
  margin: 0;
  animation: fadeInUp 1.2s ease forwards;
}

footer p::before {
  content: "⋯ ";
  opacity: 0.4;
}

[data-theme="dark"] footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] footer p::before {
  opacity: 0.3;
}

/* ===== Sparkling Star Animation ===== */
.star {
  display: inline-block;
  animation: star-blink 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes star-blink {
  0% { transform: scale(0.9); opacity: 0.6; filter: brightness(0.8); }
  30% { transform: scale(1.3); opacity: 1; filter: brightness(2.0); }
  60% { transform: scale(1.1); opacity: 0.9; filter: brightness(1.2); }
  100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}




/* ===== Starfield Background ===== */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  pointer-events: none;
  opacity: 1.0;
}




/* ===== Outreach Page ===== */
.outreach-intro {
  max-width: 900px;
  margin: 0 auto 40px auto;
  font-size: 1.05em;
  line-height: 1.6;
}

.outreach-intro p {
  margin-bottom: 20px;
}

.image-carousel {
  margin: 30px 0;
}

.image-carousel img {
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
}


