:root {
  --ink: #1d2a33;
  --muted: #5c6b75;
  --brand: #0f4c5c;
  --brand-2: #1f7a8c;
  --accent: #e9a23b;
  --bg: #ffffff;
  --bg-alt: #f3f7f8;
  --line: #dde6e9;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 76, 92, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-2); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.en { color: var(--muted); font-weight: 400; font-size: 0.85em; }
.muted { color: var(--muted); }

/* ---- 導覽列 ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--brand); text-decoration: none; letter-spacing: .02em; }
.links { display: flex; gap: 26px; }
.links a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.links a:hover { color: var(--brand-2); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---- 首頁大區塊：左文字、右分子圖 ---- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 80px 0;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.eyebrow { margin: 0 0 8px; opacity: .85; font-size: .95rem; letter-spacing: .05em; }
.hero h1 { margin: 0; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.25; }
.name-en { margin: 4px 0 0; font-size: 1.05rem; opacity: .8; }
.tagline { font-size: clamp(1.05rem, 2.2vw, 1.3rem); margin: 22px 0 8px; font-weight: 500; }
.intro { opacity: .92; margin: 0; }
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.7); color: #fff; text-decoration: none; font-weight: 500;
}
.btn.primary { background: #fff; color: var(--brand); border-color: #fff; }
.hero-figure { margin: 0; }
.hero-figure img {
  width: 100%; height: auto; border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

/* ---- 區塊 ---- */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 32px; color: var(--brand); }
h2 small { display: block; font-size: .5em; color: var(--muted); font-weight: 400; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }

/* ---- 研究方向 ---- */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.r-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.r-card img { border-radius: 10px; margin-bottom: 16px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.r-num { font-family: "Inter", sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--accent); margin-bottom: 6px; }
.r-card h3 { margin: 0; font-size: 1.15rem; }
.r-card .en { margin: 2px 0 10px; }
.r-card p { margin: 0; }

/* ---- 主持人 ---- */
.pi-card {
  display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start;
  background: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.pi-photo { width: 260px; aspect-ratio: 3 / 4; height: auto; object-fit: cover; border-radius: 12px; }
.pi-body h3 { margin: 0; font-size: 1.5rem; }
.pi-body .role { margin: 2px 0 12px; color: var(--brand-2); font-weight: 500; }
.pi-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 12px; }
.pi-cols h4 { margin: 0 0 4px; color: var(--brand); }
.pi-cols ul { margin: 0; padding-left: 1.1em; }

/* ---- 成員：直式照片卡片 ---- */
.group { margin-bottom: 44px; }
.group-title { font-size: 1.15rem; border-left: 4px solid var(--accent); padding-left: 12px; margin: 0 0 22px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.person {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-align: center; padding-bottom: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.person:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15, 76, 92, 0.14); }
.p-photo { width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; margin-bottom: 14px; }
.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d7e8ec, #b9d6dd); color: var(--brand);
  font-weight: 700; font-size: 2rem; letter-spacing: .04em;
}
.pi-photo.placeholder { font-size: 3rem; }
.p-name { font-weight: 700; font-size: 1.05rem; padding: 0 12px; }
.p-role { color: var(--brand-2); font-size: .92rem; padding: 0 12px; }
.p-topic { color: var(--muted); font-size: .88rem; line-height: 1.5; margin-top: 4px; padding: 0 12px; }
.alumni { margin: 0; padding-left: 1.1em; }

/* ---- 實驗室生活相簿 ---- */
.album { margin-bottom: 48px; }
.album:last-child { margin-bottom: 0; }
.album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-left: 4px solid var(--accent); padding-left: 12px; margin-bottom: 8px; }
.album-head h3 { margin: 0; font-size: 1.15rem; }
.album-date { color: var(--muted); font-size: .9rem; }
.album-desc { margin: 0 0 18px; color: var(--muted); max-width: 760px; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: 14px; margin-top: 16px; }
.ph {
  position: relative; display: block; padding: 0; border: 0; cursor: zoom-in;
  border-radius: 12px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
}
.ph.wide { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
/* 只有 1～2 張時改為並排，不做拼貼 */
.album-grid[data-n="1"] { grid-template-columns: 1fr; max-width: 820px; }
.album-grid[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.album-grid[data-n="1"] .ph.wide, .album-grid[data-n="2"] .ph.wide { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
.ph:hover img { transform: scale(1.04); }
.ph-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65)); color: #fff;
  font-size: .88rem; text-align: left; line-height: 1.45;
}

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(8, 14, 20, .92);
  display: flex; align-items: center; justify-content: center; padding: 56px 64px;
}
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; }
.lb-figure figcaption { color: #e6edf2; margin-top: 12px; text-align: center; font-size: .95rem; }
.lb-close, .lb-nav {
  position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  cursor: pointer; border-radius: 999px; line-height: 1;
}
.lb-close { top: 14px; right: 16px; width: 44px; height: 44px; font-size: 1.8rem; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 2rem; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .25); }

/* ---- 著作 ---- */
.pubs { margin: 0 0 24px; padding-left: 1.4em; }
.pubs li { margin-bottom: 14px; font-size: .95rem; overflow-wrap: anywhere; }
.pubs strong { color: var(--brand); }
.pub-group { font-size: 1.05rem; border-left: 4px solid var(--accent); padding-left: 12px; margin: 0 0 16px; }

/* ---- 聯絡 ---- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.c-info p { margin: 0 0 12px; }
.label { display: inline-block; min-width: 64px; color: var(--muted); font-size: .9rem; }
.recruit { margin-top: 20px !important; padding: 14px 18px; background: var(--bg-alt); border-radius: 10px; }
.map { width: 100%; height: 280px; border: 0; border-radius: var(--radius); }

.footer { background: var(--brand); color: rgba(255,255,255,.85); padding: 26px 0; font-size: .9rem; }

/* ---- 平板 ---- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-figure { max-width: 640px; }
}

/* ---- 手機版 ---- */
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line);
  }
  .links.open { display: flex; }
  .links a { padding: 14px 20px; border-top: 1px solid var(--line); }
  .hero { padding: 52px 0 56px; }
  .hero-figure img { border-radius: 12px; }
  .section { padding: 52px 0; }
  .pi-card { grid-template-columns: 1fr; padding: 24px; gap: 20px; text-align: center; }
  .pi-photo { margin: 0 auto; width: 200px; }
  .pi-cols { grid-template-columns: 1fr; text-align: left; }
  .people { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .person { padding-bottom: 12px; }
  .p-photo { margin-bottom: 10px; }
  .p-name { font-size: 1rem; }
  .contact { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ph.wide { grid-row: span 1; aspect-ratio: 16 / 10; }
  .album-grid[data-n="1"], .album-grid[data-n="2"] { grid-template-columns: 1fr; }
  .ph-cap { font-size: .8rem; padding: 18px 8px 8px; }
  .lightbox { padding: 56px 8px 70px; }
  .lb-nav { top: auto; bottom: 14px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
