/* ============================================================
   洪明辉教授课题组网站 · Global Styles
   Aesthetic: Refined Academic — warm parchment, deep navy, gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg:          #f7f5f0;
  --bg-alt:      #efecea;
  --navy:        #1c2b4a;
  --navy-light:  #263652;
  --gold:        #b8870a;
  --gold-light:  #d4a520;
  --teal:        #3a7a8c;
  --text:        #1e1e1e;
  --text-mid:    #4a4a4a;
  --text-light:  #7a7a7a;
  --border:      #ddd9d0;
  --white:       #ffffff;

  --font-serif:  'Playfair Display', Georgia, serif;
  --font-sans:   'Source Sans 3', system-ui, sans-serif;

  --radius:      6px;
  --shadow:      0 2px 16px rgba(28,43,74,0.10);
  --shadow-lg:   0 8px 40px rgba(28,43,74,0.14);
  --transition:  0.25s ease;
  --max-w:       1140px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a  { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.3; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }

p { margin-bottom: 1rem; }
ul { list-style: none; }

/* ── Layout Helpers ───────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
.section    { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--navy);
  margin-bottom: 0.4rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* ── Header / Nav ─────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-decoration: none;
}
.site-logo .logo-en {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
}
.site-logo .logo-zh {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.04em;
}

nav { display: flex; align-items: center; gap: 0.25rem; }

nav a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
}
nav a:hover, nav a.active {
  color: var(--white);
  background: rgba(255,255,255,0.10);
}
nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
}

.header-right { display: flex; align-items: center; gap: 0.75rem; }

.lang-toggle {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}
.lang-toggle button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.6);
  padding: 4px 10px;
  border-radius: 18px;
  transition: all var(--transition);
}
.lang-toggle button.active {
  background: var(--gold);
  color: var(--white);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--white);
  padding: 6px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: currentColor; margin: 4px 0;
  transition: all var(--transition);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(184,135,10,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(58,122,140,0.15) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; }
.hero-tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
  font-weight: 500;
}
.hero h1 { color: var(--white); margin-bottom: 0.75rem; }
.hero p   { color: rgba(255,255,255,0.7); font-size: 1.1rem; max-width: 600px; }

/* page hero (smaller) */
.page-hero {
  background: var(--navy);
  padding: 3.5rem 0;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(184,135,10,0.10) 0%, transparent 55%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-hero p  { color: rgba(255,255,255,0.65); margin-top: 0.5rem; font-size: 1.05rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* News item card */
.news-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 3px solid var(--gold);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  margin-bottom: 1rem;
}
.news-item:hover { transform: translateX(4px); }
.news-date {
  font-size: 0.82rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.news-title {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Home: About Profile ──────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}
.profile-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--bg-alt);
}
.profile-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-alt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 3rem;
  box-shadow: var(--shadow-lg);
}
.profile-info h2 { color: var(--navy); margin-bottom: 0.25rem; }
.profile-title   { font-size: 1.05rem; color: var(--teal); margin-bottom: 1.25rem; font-weight: 500; }
.profile-meta    { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.profile-meta-item { display: flex; gap: 0.75rem; align-items: flex-start; font-size: 0.92rem; }
.profile-meta-item .icon { color: var(--gold); flex-shrink: 0; width: 20px; margin-top: 2px; }
.bio-text { color: var(--text-mid); font-size: 0.97rem; }

/* Fellow badges */
.fellow-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Research Interests Grid ──────────────────────────────── */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.interest-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
  transition: transform var(--transition), box-shadow var(--transition);
}
.interest-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.interest-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--border);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.interest-card h3 { color: var(--navy); margin-bottom: 0.75rem; font-size: 1.1rem; }
.interest-card p  { color: var(--text-mid); font-size: 0.9rem; line-height: 1.65; margin: 0; }

/* ── Projects Table ───────────────────────────────────────── */
.projects-list { display: flex; flex-direction: column; gap: 0.75rem; }
.project-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}
.project-num {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 600;
  min-width: 36px;
}
.project-title   { font-size: 0.93rem; color: var(--text); font-weight: 500; }
.project-sub     { font-size: 0.82rem; color: var(--text-light); margin-top: 2px; }
.project-meta    { text-align: right; }
.project-amount  { font-size: 0.85rem; color: var(--teal); font-weight: 600; }
.project-years   { font-size: 0.78rem; color: var(--text-light); }
.project-role-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── Facilities ───────────────────────────────────────────── */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.facility-group { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.facility-group h4 { color: var(--navy); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.75rem; font-family: var(--font-sans); font-weight: 600; }
.facility-group li { font-size: 0.88rem; color: var(--text-mid); padding: 4px 0; border-bottom: 1px solid var(--border); }
.facility-group li:last-child { border: none; }

/* ── Group / Members ──────────────────────────────────────── */
.pi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 2rem;
  align-items: center;
  border-left: 4px solid var(--gold);
}
.pi-photo {
  width: 110px; height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--bg-alt);
}
.pi-info h3 { color: var(--navy); margin-bottom: 0.25rem; }
.pi-role    { color: var(--gold); font-size: 0.9rem; font-weight: 600; margin-bottom: 0.75rem; letter-spacing: 0.02em; }

.members-section-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.member-card:hover { transform: translateY(-2px); }
.member-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--text-light);
}
.member-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.member-name-zh  { font-size: 1rem; font-weight: 600; color: var(--navy); }
.member-name-en  { font-size: 0.8rem; color: var(--text-light); margin-top: 2px; }
.member-year     { font-size: 0.75rem; color: var(--gold); margin-top: 0.4rem; }

.alumni-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.alumni-table th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-family: var(--font-sans);
  font-weight: 600;
}
.alumni-table td { padding: 0.85rem 1.25rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.alumni-table tr:last-child td { border: none; }
.alumni-table tr:hover td { background: var(--bg); }

/* ── Opening Cards ────────────────────────────────────────── */
.opening-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--teal);
}
.opening-card h3 { color: var(--navy); margin-bottom: 0.75rem; }
.opening-card p  { color: var(--text-mid); font-size: 0.93rem; }
.opening-tag {
  display: inline-block;
  background: rgba(58,122,140,0.1);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}
.deadline-info { font-size: 0.85rem; color: var(--text-light); margin-top: 0.75rem; }
.deadline-info strong { color: var(--text); }

/* ── Button ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
}
.btn-primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-outline {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--white); }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.82rem; }

/* ── Zotero banner ────────────────────────────────────────── */
.zotero-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.zotero-banner p { margin: 0; color: rgba(255,255,255,0.85); }
.zotero-banner strong { color: var(--white); }

/* ── Experience Timeline ──────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.45rem; top: 6px;
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--bg);
}
.timeline-period { font-size: 0.8rem; color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }
.timeline-role   { font-weight: 600; color: var(--navy); }
.timeline-org    { color: var(--text-mid); font-size: 0.9rem; }

/* ── Activity sections ────────────────────────────────────── */
.activity-group { margin-bottom: 2rem; }
.activity-group h4 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-weight: 700;
}
.activity-list { display: flex; flex-direction: column; gap: 0.4rem; }
.activity-list li {
  font-size: 0.9rem;
  color: var(--text-mid);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background var(--transition);
}
.activity-list li:hover { background: var(--bg-alt); }

/* ── Loading ──────────────────────────────────────────────── */
.loading-dots {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  padding: 3rem 0;
}
.loading-dots span {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* ── Footer ───────────────────────────────────────────────── */
#site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding: 3.5rem 0 2rem;
}
.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.footer-desc { font-size: 0.85rem; line-height: 1.7; }
.footer-col h5 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-weight: 700;
}
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul a { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-col ul a:hover { color: var(--gold-light); }
.footer-contact-item { display: flex; gap: 0.5rem; font-size: 0.85rem; margin-bottom: 0.5rem; align-items: flex-start; }
.footer-contact-item .ic { color: var(--gold-light); flex-shrink: 0; margin-top: 2px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-photo, .profile-photo-placeholder { max-width: 200px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .project-item { grid-template-columns: auto 1fr; }
  .project-meta { grid-column: 2; }
}

@media (max-width: 680px) {
  .container { padding: 0 1.25rem; }
  .section   { padding: 3.5rem 0; }

  nav { display: none; position: absolute; top: 68px; left: 0; right: 0;
        background: var(--navy); flex-direction: column; padding: 0.75rem 1rem; gap: 0.25rem; }
  nav.open { display: flex; }
  nav a { text-align: left; padding: 0.6rem 1rem; }

  .menu-toggle { display: block; }
  .footer-inner { grid-template-columns: 1fr; }
  .pi-card { flex-direction: column; align-items: flex-start; }
  .interests-grid { grid-template-columns: 1fr; }
}

/* ── Fade-in animation on load ────────────────────────────── */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: none; }

/* ── Utility ──────────────────────────────────────────────── */
.text-gold  { color: var(--gold); }
.text-teal  { color: var(--teal); }
.text-navy  { color: var(--navy); }
.text-light { color: var(--text-light); }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.flex-gap { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Admin nav button ─────────────────────────────────────── */
.admin-nav-btn {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(255,255,255,.55);
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 4px;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.admin-nav-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.08);
}

/* ============================================================
   Responsive Design — Mobile / Tablet / Desktop
   ============================================================ */

/* ── Tablet (≤ 900px) ──────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --max-w: 100%; }

  .section { padding: 3.5rem 0; }

  /* Profile */
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .profile-photo-placeholder {
    width: 160px;
    height: 200px;
    font-size: 4rem;
  }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }

  /* Projects */
  .project-item {
    grid-template-columns: auto 1fr;
    gap: .75rem;
  }
  .project-meta { grid-column: 2; text-align: left; }

  /* PI card */
  .pi-card { gap: 1.25rem; }

  /* Grid 2 */
  .grid-2 { grid-template-columns: 1fr; gap: 1.25rem; }

  /* Members grid */
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  /* Interests */
  .interests-grid { grid-template-columns: repeat(2, 1fr); }

  /* Facilities */
  .facilities-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile (≤ 640px) ──────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  .section { padding: 2.5rem 0; }

  /* Hero */
  .hero { padding: 3.5rem 0 3rem; }
  .page-hero { padding: 2.5rem 0; }
  .hero h1 { font-size: 2rem; }
  .page-hero h1 { font-size: 1.6rem; }

  /* Header */
  .header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding: .5rem 0; }
  .site-logo .logo-en { font-size: .9rem; }
  .admin-nav-btn { font-size: .72rem; padding: 3px 8px; }

  /* Nav mobile */
  nav {
    display: none;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: .5rem 1rem;
    gap: .15rem;
    z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
  }
  nav.open { display: flex; }
  nav a { text-align: left; padding: .55rem 1rem; font-size: .85rem; border-radius: 4px; }
  .menu-toggle { display: block; }

  /* Section title */
  .section-title { font-size: 1.4rem; }

  /* Profile */
  .profile-photo-placeholder { width: 120px; height: 150px; font-size: 3rem; }
  .bio-text { font-size: .9rem; }
  .fellow-badges { gap: .4rem; }
  .badge { font-size: .68rem; padding: 3px 8px; }

  /* Research interests */
  .interests-grid { grid-template-columns: 1fr; }
  .interest-card { padding: 1.5rem 1.25rem; }
  .interest-num { font-size: 2rem; }

  /* News */
  .news-item { padding: 1.1rem 1rem; }

  /* PI card */
  .pi-card { flex-direction: column; align-items: flex-start; padding: 1.25rem; gap: 1rem; }
  .pi-photo { width: 80px; height: 100px; font-size: 2rem; }

  /* Members */
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
  .member-card { padding: 1rem .75rem; }
  .member-avatar { width: 56px; height: 56px; font-size: 1.25rem; }
  .member-name-zh { font-size: .9rem; }
  .member-name-en { font-size: .72rem; }

  /* Alumni table — scroll on mobile */
  .alumni-table { font-size: .82rem; }
  .alumni-table th, .alumni-table td { padding: .6rem .75rem; }
  div:has(> .alumni-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Projects */
  .project-item {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1rem;
  }
  .project-num { font-size: 1.1rem; min-width: auto; }
  .project-meta { text-align: left; }

  /* Facilities */
  .facilities-grid { grid-template-columns: 1fr; }

  /* Opening card */
  .opening-card { padding: 1.25rem; }

  /* Zotero banner */
  .zotero-banner { flex-direction: column; gap: 1rem; padding: 1.5rem; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; padding: 2rem 0 1.5rem; }
  .footer-logo { font-size: 1rem; }
  .footer-desc { font-size: .82rem; }

  /* Timeline */
  .timeline { padding-left: 1.5rem; }
  .timeline-item::before { left: -1.95rem; }

  /* Activity grid */
  .grid-2 { grid-template-columns: 1fr; gap: 1rem; }

  /* Buttons */
  .btn { font-size: .82rem; padding: .5rem 1.1rem; }
  .hero .btn { width: 100%; justify-content: center; }
  .hero > .container > div:last-child { flex-direction: column; gap: .75rem; }

  /* Pagination */
  #pagination { gap: .5rem; }
  #pagination button { padding: .35rem .75rem; font-size: .8rem; }
}

/* ── Very small screens (≤ 380px) ─────────────────────────── */
@media (max-width: 380px) {
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .interests-grid { grid-template-columns: 1fr; }
  .header-inner { gap: .5rem; }
  .lang-toggle button { padding: 3px 7px; font-size: .72rem; }
}

/* ── Large screens (≥ 1280px) ─────────────────────────────── */
@media (min-width: 1280px) {
  :root { --max-w: 1200px; }
  .interests-grid { grid-template-columns: repeat(4, 1fr); }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ── Role badge colors ──────────────────────────────────────── */
.role-phd     { background: rgba(28,43,74,.10);   color: var(--navy); }
.role-master  { background: rgba(58,122,140,.12); color: var(--teal); }
.role-engineer{ background: rgba(184,135,10,.12); color: var(--gold); }
.role-postdoc { background: rgba(103,65,149,.12); color: #674195; }
.role-staff   { background: rgba(39,174,96,.12);  color: #27ae60; }
.role-alumni  { background: var(--bg-alt);        color: var(--text-light); }
.role-PI      { background: rgba(28,43,74,.10);   color: var(--navy); }
.role-Co-PI   { background: rgba(58,122,140,.12); color: var(--teal); }
.role-Manager { background: rgba(184,135,10,.12); color: var(--gold); }
