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

:root {
  --bg:        #000000;
  --surface:   #0d0d0d;
  --surface-2: #1a1a1a;
  --text:      #ffffff;
  --muted:     rgba(255,255,255,0.58);
  --border:    rgba(255,255,255,0.1);
  --accent:    #8ec8f0;
  --white:     #ffffff;
  --transition: 0.32s ease;
  --max-w:     1400px;
  --font:      'Inter', 'Noto Sans TC', system-ui, sans-serif;
}

/* ===== Base ===== */
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.65; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--white); }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 36px; }

/* ===== Language Toggle ===== */
[data-lang="zh"] { display: none !important; }
body.zh [data-lang="zh"] { display: revert !important; }
body.zh [data-lang="en"] { display: none !important; }

/* ===== Navigation ===== */
#navbar {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.45s ease, border-color 0.45s ease;
}
#navbar.scrolled {
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom-color: var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 86px;
}
.nav-logo {
  display: flex; align-items: center; gap: 14px;
  font-size: 1.2rem; font-weight: 700; color: var(--white); line-height: 1.25;
}
.nav-logo-img { height: 48px; width: auto; object-fit: contain; flex-shrink: 0; opacity: 0.9; }
.nav-logo span { display: block; font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-links a {
  padding: 8px 16px; font-size: 0.98rem; font-weight: 500;
  color: rgba(255,255,255,0.82); letter-spacing: 0.01em;
  transition: color var(--transition), background var(--transition);
  border-radius: 2px;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); background: rgba(255,255,255,0.07); }
.lang-btn {
  margin-left: 12px; padding: 6px 17px;
  border: 1px solid rgba(255,255,255,0.35); background: transparent;
  color: rgba(255,255,255,0.82); font-size: 0.94rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); border-radius: 2px;
}
.lang-btn:hover { background: rgba(255,255,255,0.1); color: var(--white); border-color: rgba(255,255,255,0.65); }
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); transition: all var(--transition); }

/* ===== HERO — Full Viewport Background ===== */
#home {
  height: 100vh; min-height: 640px;
  display: flex; align-items: flex-end;
  background-image: url('photo/hero-bg.jpg');
  background-size: cover; background-position: center 25%;
  position: relative; overflow: hidden;
  padding-top: 86px;
}
#home::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.6)  38%,
    rgba(0,0,0,0.25) 70%,
    rgba(0,0,0,0.12) 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  padding-top: 100px; padding-bottom: 60px; width: 100%;
  max-width: 960px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.72); font-size: 0.6rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 20px; font-weight: 400;
}
.hero-badge::before {
  content: ''; width: 7px; height: 7px;
  background: #4ade80; border-radius: 50%;
  flex-shrink: 0; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

.hero-title {
  font-size: clamp(1.6rem, 3.67vw, 3.33rem);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.025em; margin-bottom: 18px; color: var(--white);
}
.hero-title .accent { color: var(--accent); }
.hero-subtitle {
  font-size: clamp(0.73rem, 1.67vw, 1.1rem);
  font-weight: 300; color: rgba(255,255,255,0.78);
  margin-bottom: 14px; letter-spacing: 0.01em;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  font-size: 0.61rem; color: rgba(255,255,255,0.55);
  margin-bottom: 34px;
}
.hero-meta span::before { content: '— '; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 34px; }

.btn {
  display: inline-block; padding: 15px 38px;
  font-weight: 600; font-size: 0.88rem;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all var(--transition);
  letter-spacing: 0.06em; text-transform: uppercase; border-radius: 0;
}
.btn-primary { background: var(--white); color: #000; border-color: var(--white); }
.btn-primary:hover { background: transparent; color: var(--white); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.45); color: var(--white); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.07); }

.hero-logo-row { display: flex; gap: 16px; align-items: center; }
.hero-lab-logo { height: 78px; width: auto; object-fit: contain; opacity: 0.9; }
.hero-cmu-logo { height: 52px; width: auto; object-fit: contain; opacity: 0.9; }

/* ===== Sections ===== */
section { padding: 120px 0; background: var(--bg); }
section.bg-white { background: var(--bg); }
section.bg-light { background: var(--surface); }

.section-header { margin-bottom: 60px; }
.section-label {
  display: inline-block; color: var(--accent);
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 16px;
}
.section-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700; color: var(--white);
  letter-spacing: -0.025em; line-height: 1.08; margin-bottom: 18px;
}
.section-desc { color: var(--muted); max-width: 580px; font-size: 1.05rem; line-height: 1.7; }
.divider { height: 1px; width: 52px; background: var(--accent); margin: 20px 0 0; }

/* ===== Quick Nav (Homepage) ===== */
.quick-nav { background: var(--surface); border-top: 1px solid var(--border); padding: 0; }
.quick-nav > .container > .section-header { padding-top: 80px; margin-bottom: 0; }
.quick-nav .section-title { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.quick-nav-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0; margin-top: 0; border-left: 1px solid var(--border);
}
.quick-nav-card {
  display: block; padding: 40px 32px;
  background: transparent; color: var(--text);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.quick-nav-card:hover { background: var(--surface-2); color: var(--text); }
.quick-nav-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.quick-nav-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.about-img-wrap { position: relative; }
.about-img-placeholder {
  width: 100%; aspect-ratio: 4/5;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); overflow: hidden;
}
.about-img-placeholder svg { width: 64px; height: 64px; opacity: 0.25; }
.about-card {
  position: absolute; bottom: -20px; right: -20px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 20px 24px; display: flex; gap: 12px; align-items: center;
}
.about-card .num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.about-card .lbl { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.about-text h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; color: var(--white); margin-bottom: 24px; }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 1rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: rgba(255,255,255,0.7); padding: 5px 14px; font-size: 0.8rem; font-weight: 500;
}

/* ===== Research ===== */
.research-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0; border: 1px solid var(--border);
}
.research-card {
  background: var(--surface); padding: 36px 32px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.research-card:hover { background: var(--surface-2); }
.research-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--white); margin-bottom: 12px; }
.research-card p { font-size: 0.875rem; color: var(--muted); line-height: 1.75; }

/* ===== Members ===== */
.members-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0; border: 1px solid var(--border);
}
.member-card {
  background: var(--surface); padding: 36px 24px; text-align: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.member-card:hover { background: var(--surface-2); }
.member-avatar {
  width: 132px; height: 132px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1a3a5c);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--white); font-weight: 700; overflow: hidden;
}
.member-name { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.member-role { font-size: 0.8rem; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.member-desc { font-size: 0.8rem; color: var(--muted); }
.join-card {
  background: var(--surface); padding: 36px 24px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  cursor: pointer; color: var(--muted); transition: background var(--transition);
}
.join-card:hover { background: var(--surface-2); color: var(--white); }
.join-card svg { width: 36px; height: 36px; opacity: 0.35; }
.join-card span { font-size: 0.875rem; font-weight: 500; }

/* ===== Publications ===== */
.pub-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.pub-filter-btn {
  padding: 7px 18px; background: transparent;
  border: 1px solid var(--border); color: var(--muted);
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all var(--transition); letter-spacing: 0.02em;
}
.pub-filter-btn:hover, .pub-filter-btn.active {
  background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.35);
}
.pub-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); }
.pub-item {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 28px;
  transition: background var(--transition);
}
.pub-item:last-child { border-bottom: none; }
.pub-item:hover { background: var(--surface-2); }
.pub-year {
  flex-shrink: 0; width: 56px; height: 56px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; text-align: center; line-height: 1.3;
}
.pub-content h4 { font-size: 0.95rem; font-weight: 600; color: var(--white); margin-bottom: 6px; line-height: 1.5; }
.pub-authors { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.pub-journal { font-size: 0.8rem; font-style: italic; color: var(--accent); }
.pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pub-tag {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--muted); padding: 2px 8px; font-size: 0.72rem;
}
.cmu-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(142,200,240,0.1); border: 1px solid rgba(142,200,240,0.25);
  color: var(--accent); padding: 2px 8px; font-size: 0.72rem; font-weight: 600;
}
.cmu-badge::before { content: '🏛'; font-size: 0.7rem; }
.pub-period-label {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; font-size: 0.78rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
}
.pub-period-label.cmu { color: var(--accent); }

/* ===== News ===== */
.news-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0; border: 1px solid var(--border);
}
.news-card {
  background: var(--surface); border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.news-card:hover { background: var(--surface-2); }
.news-date { padding: 12px 20px; font-size: 0.78rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
.news-body { padding: 24px; }
.news-body h4 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 10px; line-height: 1.4; }
.news-body p { font-size: 0.85rem; color: var(--muted); line-height: 1.65; }

/* ===== Contact ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.contact-info h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; color: var(--white); margin-bottom: 20px; }
.contact-info p { color: var(--muted); margin-bottom: 36px; }
.info-row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.info-icon {
  width: 44px; height: 44px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--muted);
}
.info-label { font-size: 0.74rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.info-val { font-size: 0.95rem; color: var(--white); font-weight: 500; margin-top: 2px; }
.contact-form { background: var(--surface); border: 1px solid var(--border); padding: 44px; }
.contact-form h3 { font-size: 1.15rem; font-weight: 700; color: var(--white); margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.08em; text-transform: uppercase; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--white); font-size: 0.9rem; font-family: var(--font);
  transition: border-color var(--transition); border-radius: 0;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: rgba(142,200,240,0.5);
}
.form-group select option { background: #1a1a1a; }
.form-group textarea { min-height: 120px; resize: vertical; }
.submit-btn {
  width: 100%; padding: 14px;
  background: var(--white); color: #000;
  border: none; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase;
  transition: all var(--transition);
}
.submit-btn:hover { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--white); }

/* ===== Footer ===== */
footer {
  background: var(--surface); color: var(--muted);
  padding: 64px 0 32px; border-top: 1px solid var(--border);
}
.footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap; padding-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
.footer-brand { max-width: 320px; }
.footer-logos { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.footer-logo-img { width: auto; object-fit: contain; opacity: 0.7; }
.footer-logos img:first-child { height: 51px; }
.footer-logos img:last-child  { height: 34px; }
.footer-brand h3 { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.footer-brand p { font-size: 0.82rem; line-height: 1.7; }
.footer-links h4 { color: var(--white); font-size: 0.72rem; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 0.82rem; color: var(--muted); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }
.footer-bottom { text-align: center; padding-top: 28px; font-size: 0.76rem; color: rgba(255,255,255,0.28); }

/* ===== Scroll Top ===== */
#scroll-top {
  position: fixed; bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border); color: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), background var(--transition);
  z-index: 999;
}
#scroll-top.visible { opacity: 1; pointer-events: all; }
#scroll-top:hover { background: rgba(255,255,255,0.16); }

/* ===== Nav Spacer ===== */
.nav-spacer { height: 86px; }

/* ===== Page Banner (Subpages) — SpaceX Scale ===== */
.page-banner {
  background: #000000;
  padding: 150px 0 132px;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.page-banner::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.4;
}
.page-banner-inner { position: relative; z-index: 1; }
.page-banner-label {
  display: inline-block; color: var(--accent);
  font-size: 0.71rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase; margin-bottom: 30px;
}
.page-banner h1 {
  font-size: clamp(1.42rem, 3.33vw, 2.66rem);
  font-weight: 700; color: var(--white);
  letter-spacing: -0.035em; line-height: 1.03;
}
.page-banner-desc {
  margin-top: 33px; color: var(--muted);
  font-size: 1.06rem; max-width: 900px; line-height: 1.65;
}
.page-banner-logos {
  display: flex; gap: 21px; align-items: center; margin-top: 54px;
}
.page-banner-logo { width: auto; object-fit: contain; opacity: 0.85; }
.page-banner-logos img:first-child { height: 104px; }
.page-banner-logos img:last-child  { height: 69px; }

/* ===== Activities Page ===== */
.activity-section { margin-bottom: 80px; }
.activity-section-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 28px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.activity-section-icon {
  width: 48px; height: 48px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.activity-section-header h3 { font-size: 1.3rem; font-weight: 700; color: var(--white); }
.activity-section-header h3 span { display: block; font-size: 0.82rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.activity-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0; border: 1px solid var(--border);
}
.activity-card {
  background: var(--surface); border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.activity-card:hover { background: var(--surface-2); }
.activity-card img {
  width: 100%; height: 220px; object-fit: cover; display: block;
  filter: brightness(0.85); transition: filter var(--transition);
}
.activity-card:hover img { filter: brightness(1); }
.activity-card-body { padding: 18px 20px; }
.activity-card-date {
  font-size: 0.72rem; color: var(--accent);
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 5px;
}
.activity-card-title { font-size: 0.92rem; font-weight: 600; color: var(--white); }
.activity-card-desc { font-size: 0.82rem; color: var(--muted); margin-top: 6px; line-height: 1.55; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-img-wrap { max-width: 420px; margin: 0 auto; }
  .about-card { right: 0; }
}
@media (max-width: 768px) {
  .nav-links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: rgba(0,0,0,0.97); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border); padding: 16px; gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 16px; }
  .hamburger { display: flex; }
  section { padding: 80px 0; }
  .pub-item { flex-direction: column; gap: 12px; }
  .footer-top { flex-direction: column; }
  .quick-nav-grid { grid-template-columns: 1fr 1fr; }
  .activity-gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .hero-btns { flex-direction: column; }
  .btn { text-align: center; }
  .quick-nav-grid { grid-template-columns: 1fr; }
  .activity-gallery { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  .hero-title { font-size: clamp(3rem, 14vw, 4.5rem); }
  .page-banner h1 { font-size: clamp(1.06rem, 5.32vw, 1.78rem); }
}
