/* =====================================================================
   Bogeng Song — personal site
   Shared stylesheet for the redesigned pages (index / research / personal)
   Clean, scientific, content-first. Edit the variables below to retheme.
   ===================================================================== */

:root {
  /* Palette */
  --bg:          #ffffff;
  --bg-alt:      #f6f7f9;
  --ink:         #1b2330;   /* primary text */
  --ink-soft:    #3f4a5a;   /* body text     */
  --muted:       #798394;   /* secondary text / captions */
  --line:        #e7e9ee;   /* hairline borders */
  --accent:      #2d5a87;   /* scholarly blue */
  --accent-dark: #1e3f5f;
  --accent-soft: #ecf2f8;   /* tinted background */

  /* Type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           Helvetica, Arial, sans-serif;

  --maxw: 880px;
}

/* ----------------------------- Base ------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 .6em;
}

p { margin: 0 0 1.1em; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
a:hover { color: var(--accent-dark); border-bottom-color: currentColor; }

strong { color: var(--ink); font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* --------------------------- Navigation --------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  border: 0;
  white-space: nowrap;
}
.nav-brand .cn { color: var(--muted); font-weight: 400; }
.nav-links {
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: .95rem;
  border: 0;
  padding-bottom: 2px;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* ----------------------------- Layout ----------------------------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.section { margin-top: 3rem; }
.section:first-child { margin-top: 0; }

/* Section heading with a small accent rule */
.section-title {
  font-size: 1.45rem;
  margin-bottom: 1.4rem;
  padding-bottom: .45rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 54px; height: 2px;
  background: var(--accent);
}

.lead { font-size: 1.12rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ------------------------------ Hero ------------------------------ */
.hero {
  display: flex;
  gap: 2.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-photo {
  flex: 0 0 auto;
  width: 210px;
  height: 250px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(27, 35, 48, .12);
}
.hero-body { flex: 1 1 320px; min-width: 280px; }
.hero-name {
  font-size: 2.3rem;
  margin-bottom: .2rem;
  letter-spacing: -.01em;
}
.hero-name .cn { color: var(--muted); font-weight: 400; font-size: 1.6rem; }
.hero-role {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero-role strong { color: var(--ink-soft); font-weight: 600; }

/* ------------------------- Tags & social -------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 1.2rem; }
.tag {
  font-size: .82rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #d9e4ef;
  padding: .25rem .7rem;
  border-radius: 999px;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-top: .3rem;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--ink-soft);
  font-size: .95rem;
  border: 0;
}
.social a:hover { color: var(--accent); }
.social i { font-size: 1.15rem; color: var(--accent); }

/* --------------------------- Focus cards -------------------------- */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}
.focus-card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.3rem;
}
.focus-card h3 {
  font-size: 1.05rem;
  margin-bottom: .4rem;
}
.focus-card p { margin: 0; font-size: .97rem; }

/* --------------------- Research-interest blocks ------------------- */
.interests { margin-top: .3rem; }
.interest {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.interest:first-child { padding-top: .2rem; }
.interest:last-child { border-bottom: 0; padding-bottom: 0; }
.interest h3 {
  font-size: 1.1rem;
  margin-bottom: .35rem;
  color: var(--accent-dark);
}
.interest p { margin: 0; }

/* ---------------------------- Timeline ---------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 1.3rem 1.6rem;
  border-left: 2px solid var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px; top: .35rem;
  width: 12px; height: 12px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.timeline .when { font-size: .85rem; color: var(--muted); }
.timeline .what { color: var(--ink); font-weight: 600; }
.timeline .where { color: var(--ink-soft); }

/* -------------------------- Publications -------------------------- */
.pub-group { margin-bottom: 2.4rem; }

.pub {
  padding: 1.15rem 0 1.15rem 1.1rem;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s ease, background .2s ease;
}
.pub:hover {
  border-left-color: var(--accent);
  background: #fbfcfd;
}
.pub:last-child { border-bottom: 0; }

.pub-title {
  font-family: var(--sans);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .3rem;
  line-height: 1.4;
}
.pub-title a { border: 0; color: var(--ink); }
.pub-title a:hover { color: var(--accent); }

.pub-authors { font-size: .95rem; margin: 0 0 .25rem; color: var(--ink-soft); }
.pub-authors .me { color: var(--ink); font-weight: 700; }

.pub-venue { font-size: .92rem; color: var(--muted); margin: 0 0 .5rem; }
.pub-venue em { color: var(--ink-soft); font-style: italic; }

/* coloured venue badge */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: .12rem .5rem;
  border-radius: 5px;
  margin-right: .55rem;
  vertical-align: 1px;
}
.badge.journal    { background: #e7f0f8; color: #1e4d77; }
.badge.preprint   { background: #fdf0e3; color: #95571a; }
.badge.conference { background: #e8f3ec; color: #2c6b41; }
.badge.project    { background: #eee9f5; color: #543c87; }
.badge.course     { background: #eef1f6; color: #3a4a63; }

/* Compact inline list (coursework, etc.) */
.course-note { font-size: .95rem; color: var(--ink-soft); }
.course-note strong { color: var(--ink); }

/* links row under a publication */
.pub-links { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .15rem; }
.pub-links a {
  font-size: .85rem;
  color: var(--accent);
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.pub-links a:hover { text-decoration: underline; }

/* Native accordion for abstracts */
details.abstract { margin-top: .55rem; }
details.abstract > summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--accent);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  user-select: none;
}
details.abstract > summary::-webkit-details-marker { display: none; }
details.abstract > summary::before {
  content: "▸";
  font-size: .8rem;
  transition: transform .15s ease;
}
details.abstract[open] > summary::before { transform: rotate(90deg); }
details.abstract > summary:hover { color: var(--accent-dark); }
details.abstract .abstract-body {
  margin-top: .7rem;
  padding: .9rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .94rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
details.abstract .abstract-body p:last-child { margin-bottom: 0; }

/* --------------------------- Personal ----------------------------- */
.interest-list { list-style: none; margin: 0; padding: 0; }
.interest-list li {
  padding: .9rem 0 .9rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: .9rem;
  align-items: flex-start;
}
.interest-list li:last-child { border-bottom: 0; }
.interest-list .ico {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1.55;
  width: 1.6rem;
  text-align: center;
}
.interest-list .txt { margin: 0; }
.interest-list .txt p { margin: 0; }

/* ----------------------------- Footer ----------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding: 1.6rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* --------------------------- Responsive --------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 2rem 1.2rem 3rem; }
  .hero { gap: 1.5rem; }
  .hero-photo { width: 150px; height: 180px; margin: 0 auto; }
  .hero-name { font-size: 1.9rem; }
  .nav-inner { padding: .7rem 1.2rem; }
  .nav-brand { font-size: 1rem; }
  .nav-links { gap: 1rem; }
}
