/* ==========================================================
   Huiqing Zhang · Academic Homepage
   Style: bold editorial grid, thin ink borders, flat color blocks
   Palette: dusty pink + sage green + ink, on paper-white
   ========================================================== */

/* ---------- 1. Color tokens ---------- */
:root {
  /* pure white background, near-black ink */
  --bg:        #ffffff;
  --surface:   #ffffff;
  --ink:       #17140f;     /* near-black */
  --ink-soft:  #4a443d;     /* secondary text */
  --ink-mute:  #857c72;     /* tertiary text */
  --line:      #e2ddd2;     /* hairline dividers — warm pale sand */
  --line-soft: #f0ece3;
  --line-strong: var(--ink); /* thin black borders for card/grid blocks */

  /* signature: dusty pink — flat block accent */
  --lotus:        #c98a83;   /* main accent — dusty rose */
  --lotus-deep:   #8a5049;   /* hover / strong accents */
  --lotus-soft:   #f3d9d5;   /* flat pink block background */
  --lotus-glow:   #faeeec;   /* lightest wash */

  /* secondary: sage green — flat block accent */
  --mist:         #93a06c;   /* sage accent */
  --mist-deep:    #626f42;   /* deep sage */
  --mist-soft:    #e3e8d1;   /* flat sage block background */

  /* neutral flat block, alternates with pink/sage */
  --sand-soft:  #f2efe9;

  /* derived */
  --link:      var(--lotus-deep);
  --link-hov:  var(--ink);

  --radius:    4px;
  --radius-lg: 4px;
  --shadow:    0 2px 12px rgba(23, 20, 15, 0.06);
  --shadow-lg: 0 8px 24px rgba(23, 20, 15, 0.12);

  --max-w:     880px;
  --serif:     "Cormorant Garamond", "Songti SC", Georgia, serif;
  --sans:      "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------- 2. Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
a:hover {
  color: var(--link-hov);
  border-bottom-color: var(--lotus);
}
em { color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 600; }

/* ---------- 3. Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.nav-brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  border: 0;
  letter-spacing: 0.3px;
}
.nav-brand:hover { color: var(--lotus-deep); }
.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-soft);
  border: 0;
  position: relative;
}
.nav-links a:hover { color: var(--lotus-deep); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--lotus);
  transform: scaleX(0);
  transition: transform .25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--lotus-deep); }

/* ---------- 4. Hero ---------- */
.hero {
  padding: 72px 28px 48px;
  background:
    radial-gradient(900px 460px at 88% -8%, rgba(201,138,131,0.14), transparent 60%),
    radial-gradient(800px 460px at -5% 30%, rgba(147,160,108,0.14), transparent 65%);
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 44px;
  align-items: start;
}

/* left column: photo + contact meta stacked underneath */
.hero-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
/* collage photo trigger — one large frame + two overlapping corner
   prints on a flat sage block, click to open the gallery lightbox */
.hero-photo-stack {
  position: relative;
  width: 230px;
  height: 300px;
  margin: 0 6px 20px 14px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.stack-block {
  position: absolute;
  left: 0;
  top: 26px;
  width: 200px;
  height: 264px;
  background: var(--mist-soft);
  border: 1.5px solid var(--lotus-deep);
  z-index: 0;
  transition: transform .3s ease;
}
.stack-photo {
  position: absolute;
  object-fit: cover;
  background: var(--surface);
  transition: transform .3s ease;
}
.stack-photo-1 {
  left: 26px;
  top: 0;
  width: 200px;
  height: 264px;
  border: 2px solid var(--lotus-deep);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}
.stack-photo-2 {
  left: -14px;
  bottom: -18px;
  width: 118px;
  height: 148px;
  border: 3px solid #fff;
  outline: 1.5px solid var(--lotus-deep);
  box-shadow: var(--shadow-lg);
  transform: rotate(-6deg);
  z-index: 3;
}
.stack-photo-3 {
  right: -16px;
  top: -16px;
  width: 92px;
  height: 92px;
  border: 3px solid #fff;
  outline: 1.5px solid var(--lotus-deep);
  box-shadow: var(--shadow);
  transform: rotate(5deg);
  z-index: 3;
}
.hero-photo-stack:hover .stack-block,
.hero-photo-stack:focus-visible .stack-block { transform: translate(-6px, 6px); }
.hero-photo-stack:hover .stack-photo-1,
.hero-photo-stack:focus-visible .stack-photo-1 { transform: translateY(-4px); }
.hero-photo-stack:hover .stack-photo-2,
.hero-photo-stack:focus-visible .stack-photo-2 { transform: rotate(-10deg) translate(-5px, 5px); }
.hero-photo-stack:hover .stack-photo-3,
.hero-photo-stack:focus-visible .stack-photo-3 { transform: rotate(9deg) translate(5px, -5px); }
.stack-hint {
  position: absolute;
  left: 126px;
  bottom: 66px;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(23, 20, 15, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 5px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.hero-photo-stack:hover .stack-hint,
.hero-photo-stack:focus-visible .stack-hint { opacity: 1; }
.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.hero-role {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.hero-role a { color: var(--lotus-deep); border: 0; }
.hero-role a:hover { color: var(--ink); }
.hero-contact {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.hero-icons {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.hero-icons a {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all .2s ease;
}
.hero-icons a:hover {
  background: var(--lotus);
  color: #fff;
  border-color: var(--lotus);
}

/* right column: name + integrated bio */
.hero-text h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.hero-zh {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--lotus-deep);
  font-weight: 500;
  margin-left: 6px;
}

/* research vision — bold statement right under the name */
.hero-vision {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 500;
  color: var(--lotus-deep);
  line-height: 1.5;
  margin: 12px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--lotus);
}
.hero-vision strong {
  color: var(--ink);
  font-weight: 600;
  font-style: normal;
}

.hero-bio {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hero-bio p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.75;
}
.hero-bio p:last-child { margin-bottom: 0; }
.hero-bio strong { color: var(--ink); }

.hero-collab {
  margin: 16px 0 0;
  color: var(--lotus-deep);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.6;
}

/* research interests — compact clickable chips */
.hero-interests {
  margin-top: 20px;
  scroll-margin-top: 90px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-block;
  padding: 7px 15px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--lotus-deep);
  background: var(--lotus-soft);
  border: 1px solid var(--lotus-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}
.chip:hover,
.chip:focus-visible {
  background: var(--lotus);
  border-color: var(--lotus);
  color: #fff;
  transform: translateY(-1px);
}

/* ---------- 5. Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 28px 64px;
}
.section {
  padding: 38px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.section:first-child { border-top: 0; padding-top: 24px; }

.section-title {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0 0 22px;
  color: var(--ink);
  position: relative;
  padding-left: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 22px;
  background: var(--lotus);
  border: 1.5px solid var(--ink);
}
.section-note {
  margin: -12px 0 18px;
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-style: italic;
}
.section-body p { margin: 0 0 14px; }

/* ---------- 6. Subpage header & buttons ---------- */
.page-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 28px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.page-header-text h1 {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.back-link {
  display: block;
  margin-bottom: 18px;
  font-size: 0.92rem;
  color: var(--lotus-deep);
  border: 0;
}
.back-link:hover { color: var(--ink); }
.btn {
  display: inline-block;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--lotus-deep);
  color: #fff;
  border: 1px solid var(--lotus-deep);
  border-radius: 999px;
  white-space: nowrap;
  transition: all .2s ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 7. Modals & lightbox ---------- */
.modal[hidden],
.lightbox[hidden] { display: none; }
.modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop,
.lightbox-backdrop {
  position: absolute;
  inset: 0;
}
.modal-backdrop { background: rgba(43, 36, 31, 0.5); }
.lightbox-backdrop { background: rgba(20, 14, 10, 0.82); }

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}
.modal-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.modal-close,
.lightbox-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close { top: 12px; right: 12px; }
.modal-close:hover { background: var(--lotus); border-color: var(--lotus); color: #fff; }

.lightbox-panel {
  position: relative;
  max-width: 560px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  background: #fff;
}
.lightbox-close {
  top: -48px;
  right: 0;
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.lightbox-close:hover { background: var(--lotus); border-color: var(--lotus); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.lightbox-nav:hover { background: var(--lotus); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-dots {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
}
.lightbox-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background .2s ease;
}
.lightbox-dots span.active { background: var(--mist); }

/* ---------- 8. Publications ---------- */
.pub {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1.5px solid var(--ink);
  align-items: start;
  position: relative;
}
.pub-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 0.5px;
}

/* flat color blocks, cycling pink / sage / sand for visual rhythm */
.pub-bg-pink { background: var(--lotus-soft); }
.pub-bg-sage { background: var(--mist-soft); }
.pub-bg-sand { background: var(--sand-soft); }

.pub-thumb {
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  aspect-ratio: 4 / 3;
}
.pub-thumb img,
.pub-thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pub-meta { min-width: 0; }
.pub-title {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
  line-height: 1.35;
}
.pub-authors {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.pub-authors strong {
  color: var(--lotus-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--lotus);
  text-underline-offset: 2px;
}
.pub-venue {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.pub-venue strong {
  font-weight: 600;
  color: var(--ink);
}
.pub-year {
  display: inline;
  white-space: nowrap;
  margin-left: 6px;
  padding: 1px 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
/* Bangyan-style inline pipe-separated links */
.pub-links {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-mute);
  line-height: 1.7;
}
.pub-links a {
  color: var(--lotus-deep);
  border-bottom: 1px dotted var(--lotus);
  padding-bottom: 0;
  transition: color .2s ease, border-color .2s ease;
}
.pub-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- 9. Timeline (Experience) ---------- */
.timeline { position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 110px;
  top: 8px; bottom: 8px;
  width: 1px;
  background: var(--line);
}
.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 14px 0;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 105px;
  top: 24px;
  width: 11px;
  height: 11px;
  background: var(--lotus);
  border: 2px solid var(--bg);
  border-radius: 50%;
  z-index: 1;
}
.timeline-date {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--lotus-deep);
  font-size: 0.95rem;
  padding-top: 14px;
  text-align: right;
}
.timeline-content h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.timeline-role {
  margin: 0 0 8px;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.timeline-content ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.timeline-content li { margin-bottom: 4px; }

/* ---------- 10. Education ---------- */
.edu-row {
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.edu-row:last-child { border-bottom: 0; }
.edu-school {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}
.edu-detail {
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin: 2px 0;
}
.edu-note {
  font-size: 0.88rem;
  color: var(--ink-mute);
  font-style: italic;
}

/* ---------- 11. Awards ---------- */
.awards {
  list-style: none;
  margin: 0;
  padding: 0;
}
.awards li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.94rem;
  color: var(--ink-soft);
}
.awards li:last-child { border-bottom: 0; }
.award-year {
  display: inline-block;
  min-width: 92px;
  margin-right: 14px;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--lotus-deep);
}

/* ---------- 12. Blog ---------- */
.blog-intro {
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.blog-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 158px;
  padding: 18px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  transition: transform .25s ease, box-shadow .25s ease;
  color: inherit;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: inherit;
}
.blog-card-pink { background: var(--lotus-soft); }
.blog-card-sand { background: var(--sand-soft); }
.blog-card-sage { background: var(--mist-soft); }
.blog-date {
  display: block;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--lotus-deep);
  margin-bottom: 6px;
}
.blog-card h3 {
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  font-size: 0.94rem;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.35;
}
.blog-card p {
  margin: 12px 0 0;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.52;
}
.blog-more {
  margin: 20px 0 0;
  font-size: 0.92rem;
  text-align: right;
}

/* ---------- 13. Footer ---------- */
.footer {
  text-align: center;
  padding: 28px 20px 36px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 0.85rem;
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 760px) {
  .nav-inner { padding: 12px 18px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 0.85rem; }

  .hero { padding: 44px 22px 32px; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .hero-photo-stack {
    width: 190px;
    height: 248px;
    margin: 0 auto 30px;
  }
  .stack-block { width: 165px; height: 218px; top: 22px; }
  .stack-photo-1 { left: 22px; width: 165px; height: 218px; }
  .stack-photo-2 { left: -12px; bottom: -14px; width: 98px; height: 122px; }
  .stack-photo-3 { right: -12px; top: -12px; width: 76px; height: 76px; }
  .stack-hint { left: 104px; bottom: 54px; }
  .hero-text h1 { font-size: 2.1rem; }
  .hero-zh { display: block; margin: 4px 0 0; font-size: 1.3rem; }
  .hero-vision { margin-left: auto; margin-right: auto; text-align: left; }
  .hero-bio { text-align: left; }
  .chip-row { justify-content: center; }

  .page-header { padding: 36px 22px 8px; }

  .container { padding: 18px 22px 48px; }
  .section { padding: 28px 0; }
  .section-title { font-size: 1.5rem; }

  .blog-list { grid-template-columns: 1fr; }
  .blog-card { min-height: 145px; }

  .pub {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pub-thumb { max-width: 240px; }

  .timeline::before { left: 6px; }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-left: 28px;
  }
  .timeline-item::before { left: 1px; top: 8px; }
  .timeline-date { text-align: left; padding-top: 0; }

  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
  .lightbox-close { top: 4px; right: 4px; }
  .lightbox-img { max-height: 64vh; }
}
