/* ================================================================
   Academic Homepage — Main Stylesheet
   Design: minimal white, Inter font, accent #2563eb
   ================================================================ */

/* ---------- Variables ---------- */
:root {
  --bg:          #ffffff;
  --bg-alt:      #f8fafc;
  --text:        #1a1a1a;
  --text-muted:  #64748b;
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --border:      #e2e8f0;
  --nav-h:       56px;
  --max-w:       900px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 'Helvetica Neue', Arial, sans-serif;
  --radius:      6px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 22px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; display: block; }
b, strong { font-weight: 600; }

/* ---------- Container ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ================================================================
   Navigation
   ================================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -.01em;
  opacity: 0;
  transition: opacity .25s ease;
}
.nav-brand.visible { opacity: 1; }
.nav-brand:hover { color: var(--accent); text-decoration: none; }

.nav-links { display: flex; gap: 2.25rem; }
.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.15rem;
  padding: .3rem;
  line-height: 1;
}

/* ================================================================
   Page Wrapper
   ================================================================ */
.page-wrapper {
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 5rem;
}

/* ================================================================
   Hero
   ================================================================ */
.hero {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 3rem;
}
.hero-avatar {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
}
.hero-body { flex: 1; min-width: 0; }
.hero-name {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}
.hero-name-cn {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: .4rem;
}
.hero-title {
  color: var(--text-muted);
  font-size: .93rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color .15s, color .15s, background .15s;
}
.hero-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
  text-decoration: none;
}
.hero-link i    { font-size: .85rem; line-height: 1; }
.hero-link .ai  { font-size: 1rem; }

/* ================================================================
   Section
   ================================================================ */
.section { margin-bottom: 3.5rem; }
.section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

/* Section header with language toggle */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.section-header .section-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: .2rem;
}
.lang-sep {
  font-size: .72rem;
  color: var(--border);
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: .1rem .25rem;
  border-radius: 3px;
  transition: color .15s;
}
.lang-btn:hover { color: var(--accent); }
.lang-btn.active { color: var(--accent); }

/* ---------- Bio ---------- */
.bio { font-size: .93rem; line-height: 1.85; text-align: justify; }
.bio p { margin-bottom: .8rem; }
.bio p:last-child { margin-bottom: 0; }

.hiring-details { margin-top: .75rem; }

.hiring-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text);
  padding-top: .6rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.hiring-summary::-webkit-details-marker { display: none; }
.hiring-summary::marker { display: none; }
.hiring-summary:hover { color: var(--accent); border-color: var(--accent); }

.hiring-chevron {
  font-size: .65rem;
  transition: transform .2s ease;
}
.hiring-details[open] .hiring-chevron { transform: rotate(180deg); }
.hiring-details[open] .hiring-summary  { margin-bottom: 1.25rem; color: var(--text-muted); }

.hiring-box {
  background: #eff6ff;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
}

/* ---------- News ---------- */
.news-list { list-style: none; }
.news-item {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .93rem;
  line-height: 1.55;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--accent);
  width: 4.75rem;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Experience ---------- */
.exp-list { display: flex; flex-direction: column; gap: 1.1rem; }
.exp-item { display: flex; gap: 1rem; }
.exp-period {
  width: 9rem;
  flex-shrink: 0;
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
  padding-top: .1rem;
  line-height: 1.4;
}
.exp-body { flex: 1; }
.exp-org   { font-weight: 600; font-size: .97rem; }
.exp-role  { font-size: .93rem; color: var(--text-muted); }
.exp-field { font-size: .9rem; color: var(--text-muted); }

/* ---------- Service ---------- */
.service-block { margin-bottom: 1rem; }
.service-block:last-child { margin-bottom: 0; }
.service-label { font-weight: 600; font-size: .93rem; margin-bottom: .25rem; }
.service-body  { font-size: .93rem; color: var(--text-muted); line-height: 1.85; }

/* ---------- Activity ---------- */
.activity-block { margin-bottom: 1.1rem; }
.activity-block:last-child { margin-bottom: 0; }
.activity-label { font-weight: 600; font-size: .93rem; margin-bottom: .35rem; }
.talk-list { list-style: none; }
.talk-item {
  font-size: .93rem;
  color: var(--text-muted);
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
}
.talk-item:last-child { border-bottom: none; }
.ta-list { list-style: none; }
.ta-item {
  font-size: .93rem;
  color: var(--text-muted);
  padding: .2rem 0;
}

/* ---------- Awards ---------- */
.award-list { list-style: none; }
.award-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.award-item:last-child { border-bottom: none; }
.award-year {
  color: var(--text-muted);
  font-size: .82rem;
  flex-shrink: 0;
  margin-left: .75rem;
}

/* ================================================================
   Publication Page
   ================================================================ */

/* Recent updates */
.update-list { list-style: none; }
.update-item {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  line-height: 1.55;
}
.update-item:last-child { border-bottom: none; }
.update-date {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--accent);
  width: 5rem;
  font-size: .8rem;
}

/* Paper list */
.pub-list { list-style: none; }
.pub-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-thumb {
  width: 130px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.pub-body  { flex: 1; min-width: 0; }
.pub-title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: .2rem;
  color: var(--text);
}
.pub-authors {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .15rem;
  line-height: 1.55;
}
.pub-venue  { font-size: .82rem; margin-bottom: .4rem; }
.pub-venue em { font-style: normal; }

.badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: .05rem .35rem;
  border-radius: 3px;
  margin-left: .3rem;
  vertical-align: .05em;
}
.badge-oral      { background: #fef2f2; color: #dc2626; }
.badge-spotlight { background: #fffbeb; color: #b45309; }
.badge-top10     { background: #fefce8; color: #854d0e; }
a.badge-top10:hover { background: #fef08a; text-decoration: none; }

.pub-links  { display: flex; flex-wrap: wrap; gap: .35rem; }
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: .15rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.pub-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: #eff6ff;
  text-decoration: none;
}
.pub-link i   { font-size: .78rem; line-height: 1; }
.pub-link .ai { font-size: .88rem; }
.pub-link .star-count {
  color: #d97706;
  font-size: .72rem;
  font-weight: 600;
}

/* ================================================================
   Others Page
   ================================================================ */
.map-section { margin-bottom: 2.5rem; }
.map-wrap {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
#travel-map { width: 100%; height: 100%; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: box-shadow .15s;
}
.photo-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.photo-card img {
  width: 100%;
  height: 185px;
  object-fit: cover;
}
.photo-caption {
  padding: .5rem .75rem;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .3rem;
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .5rem;
  padding: 2rem;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .88rem;
  text-align: center;
  grid-column: 1 / -1;
}
.photo-placeholder i { font-size: 2rem; opacity: .4; }


/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 640px) {
  :root { --max-w: 100%; }

  body { font-size: 16px; }

  .page-wrapper { padding-top: calc(var(--nav-h) + 1.75rem); padding-bottom: 3rem; }

  /* Hero: image on top, text below; avatar centered */
  .hero { flex-direction: column; gap: 1.25rem; align-items: flex-start; }
  .hero-avatar { order: -1; width: 100px; height: 100px; border-radius: 50%; }
  .hero-name { font-size: 1.55rem; }
  .hero-name-cn { font-size: 1rem; }

  /* No justify on narrow screens */
  .bio { text-align: left; }

  .section { margin-bottom: 2.25rem; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    padding: .5rem 0;
    z-index: 199;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 1.5rem; font-size: .95rem; }
  .nav-toggle { display: block; }

  .pub-item { flex-direction: column; }
  .pub-thumb { width: 100%; height: 160px; }

  .exp-item { flex-direction: column; gap: .05rem; }
  .exp-period { width: auto; }
}
