/* ===== CSS Custom Properties ===== */
:root {
  --primary: #1a3a5c;
  --accent: #2c7da0;
  --bg: #f1f3f6;
  --card: #ffffff;
  --text: #2d3748;
  --subtle: #718096;
  --border: #e2e8f0;
  --banner-bg: #e8edf2;
  --nav-height: 80px;
  --max-width: 1240px;
  --font-serif: Georgia, "Noto Serif SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --radius: 4px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary);
  text-decoration: underline;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--primary);
  line-height: 1.3;
}

h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }

/* ===== Utility Classes ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 90px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--primary);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
}
.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* ===== Page Banner ===== */
.page-banner {
  background: linear-gradient(160deg, #0d1f3c 0%, #1a3a5c 40%, #1e4d7b 100%);
  padding: 60px 0;
  text-align: center;
  position: relative;
}
.page-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(44,125,160,0.2) 0%, transparent 60%);
}
.page-banner h1 {
  margin-bottom: 8px; color: #fff; position: relative; z-index: 1;
}
.page-banner p {
  color: rgba(255,255,255,0.7); font-size: 1rem; position: relative; z-index: 1;
}

/* ===== Hero ===== */
/* Hero styles are now inline in index.html */

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid #d0d7e0;
  border-radius: 10px;
  padding: 28px;
  transition: box-shadow 0.3s, transform 0.25s, border-color 0.3s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.13);
  transform: translateY(-3px);
  border-color: var(--accent);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff, #dce3f0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  color: var(--primary);
}
.card h3 {
  margin-bottom: 10px; font-weight: 700; color: var(--primary);
}
.card p {
  color: var(--text); font-size: 0.95rem; line-height: 1.6;
}

/* ===== Grid Layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ===== Member Cards ===== */
.member-card {
  background: var(--card);
  border: 1px solid #d0d7e0;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  transition: box-shadow 0.3s, transform 0.25s, border-color 0.3s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}
.member-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.13);
  transform: translateY(-3px);
  border-color: var(--accent);
}
.member-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  background: var(--banner-bg);
}
.member-photo-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: var(--banner-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--subtle);
}
.member-card .member-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.member-card .member-role {
  color: var(--subtle);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.member-card .member-bio {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}
.member-card-pi {
  grid-column: 1 / -1;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding: 32px;
}
.member-card-pi .member-photo,
.member-card-pi .member-photo-placeholder {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin: 0;
}
.member-card-pi .member-name {
  font-size: 1.25rem;
}
.member-card-pi .member-bio {
  margin-top: 10px;
  line-height: 1.7;
}
.member-card-pi .member-email {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.9rem;
}

/* ===== Publication Items ===== */
.pub-item {
  padding: 20px 0;
  border-bottom: 1px solid #dde1e7;
}
.pub-item:last-child {
  border-bottom: none;
}
.pub-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 4px;
  line-height: 1.5;
}
.pub-authors {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.6;
}
.pub-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.pub-journal {
  font-style: italic;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.pub-year {
  color: var(--subtle);
  font-size: 0.85rem;
}
.pub-doi {
  font-size: 0.85rem;
  color: var(--accent);
}
.pub-year-heading {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

/* ===== News Timeline ===== */
.news-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child {
  border-bottom: none;
}
.news-date {
  flex-shrink: 0;
  width: 110px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--subtle);
  padding-top: 4px;
}
.news-content {
  flex: 1;
}
.news-content h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--primary);
}
.news-content p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}
.news-content p a {
  color: var(--accent);
}

/* ===== Latest Section (Homepage) ===== */
.latest-section {
  background: var(--bg);
}
.latest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.latest-list {
  list-style: none;
}
.latest-list li {
  padding: 14px 0;
  border-bottom: 1px solid #dde1e7;
}
.latest-list li:last-child {
  border-bottom: none;
}
.latest-list .item-date {
  font-size: 0.8rem;
  color: var(--subtle);
  margin-bottom: 2px;
}
.latest-list .item-title {
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.latest-list .item-title a {
  color: var(--text);
  text-decoration: none;
}
.latest-list .item-title a:hover {
  color: var(--accent);
}

/* ===== Contact Page ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-info p {
  margin-bottom: 12px;
  line-height: 1.8;
}
.contact-info .label {
  font-weight: 600;
  color: var(--primary);
  min-width: 80px;
  display: inline-block;
}
.join-box {
  background: var(--banner-bg);
  border-radius: var(--radius);
  padding: 32px;
}
.join-box h3 {
  margin-bottom: 12px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar select,
.filter-bar input {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--card);
  color: var(--text);
}
.filter-bar input {
  min-width: 240px;
}
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.8);
  padding: 40px 0;
  font-size: 0.9rem;
  line-height: 1.8;
}
.footer a {
  color: rgba(255, 255, 255, 0.9);
}
.footer a:hover {
  color: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 12px;
}
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 12px 24px;
    gap: 0;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 320px;
  }
  .hero h1 {
    font-size: 1.8rem;
  }

  .grid-2, .grid-3, .latest-grid, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
  }

  .member-card-pi {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .news-item {
    flex-direction: column;
    gap: 6px;
  }
  .news-date {
    width: auto;
    text-align: left;
  }

  .section {
    padding: 48px 0;
  }
  .page-banner {
    padding: 32px 0;
  }
}
