:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe4f0;
  --accent: #1f3b73;
  --accent-soft: #e8efff;
  --accent-coral: #d97786;
  --accent-mint: #2f8f83;
  --accent-amber: #c79a3b;
  --accent-purple: #8b5cf6;
  --max-width: 1080px;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #eef3ff 0%, var(--bg) 35%, var(--bg) 100%);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 0.16em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-mint);
  text-decoration-color: color-mix(in srgb, var(--accent-mint) 60%, transparent);
}

.container {
  width: min(calc(100% - 2.5rem), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.nav-wrap {
  min-height: 4.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-title {
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.site-nav a.active,
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
}

.page-shell {
  padding: 3rem 0 4rem;
}

.hero-card,
.content-card,
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.4rem, 2vw + 1rem, 2.2rem);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.74rem;
}

h1,
h2 {
  line-height: 1.25;
}

h1 {
  margin: 0.45rem 0 0.9rem;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.lead,
.section-note {
  color: var(--muted);
  max-width: 70ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.button {
  display: inline-block;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  border: 1px solid transparent;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
}

.button-soft {
  background: #fff;
  color: var(--accent);
  border-color: var(--line);
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.profile-card {
  text-align: center;
}

.profile-visual-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}

.profile-image {
  width: min(100%, 250px);
  border-radius: 14px;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 0.95rem;
}

.emoji-effect-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.effect-emoji {
  position: absolute;
  display: inline-block;
  font-size: clamp(0.85rem, 1.2vw, 1.1rem);
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--emoji-scale, 1));
  filter: drop-shadow(0 1px 3px rgba(15, 23, 42, 0.14));
  will-change: transform, opacity;
}

.effect-nature {
  animation: blossomFloat 3.8s ease-in-out infinite;
}

.effect-basketball {
  animation: ballBounce 2.7s ease-in-out infinite;
}

.effect-music {
  animation: noteSway 2.9s ease-in-out infinite;
}

.effect-music-click {
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  opacity: 0.12;
  text-shadow: 0 1px 6px rgba(15, 23, 42, 0.14);
  animation: gentleFade 2.9s ease-in-out infinite;
}

.profile-name {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.1rem);
}

.profile-chinese,
.profile-role,
.profile-focus {
  margin: 0;
}

.profile-chinese {
  font-size: 1.06rem;
}

.profile-role {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-focus {
  margin-top: 0.2rem;
  color: #5d6f90;
  font-size: 0.82rem;
}

.mini-links {
  margin-top: 0.95rem;
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}

.mini-links a {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  background: #fff;
  font-size: 0.95rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.email-icon {
  color: var(--muted);
  line-height: 1;
}

.mini-links a:hover,
.mini-links a:focus-visible {
  transform: translateY(-1px);
}

.mini-links a:nth-child(1):hover,
.mini-links a:nth-child(1):focus-visible {
  border-color: color-mix(in srgb, var(--accent-coral) 45%, white);
  background: color-mix(in srgb, var(--accent-coral) 12%, white);
}

.mini-links a:nth-child(1):active {
  border-color: color-mix(in srgb, var(--accent) 45%, white);
  background: color-mix(in srgb, var(--accent) 14%, white);
}

.mini-links a:nth-child(1):active .email-icon {
  color: var(--accent);
}

.mini-links a:nth-child(2):hover,
.mini-links a:nth-child(2):focus-visible {
  border-color: color-mix(in srgb, var(--accent-mint) 45%, white);
  background: color-mix(in srgb, var(--accent-mint) 12%, white);
}

.mini-links a:nth-child(3):hover,
.mini-links a:nth-child(3):focus-visible,
.mini-links a:nth-child(3):active {
  border-color: color-mix(in srgb, var(--accent-purple) 45%, white);
  background: color-mix(in srgb, var(--accent-purple) 14%, white);
}

.mini-links a:nth-child(4):hover,
.mini-links a:nth-child(4):focus-visible,
.mini-links a:nth-child(4):active {
  border-color: color-mix(in srgb, var(--accent-amber) 45%, white);
  background: color-mix(in srgb, var(--accent-amber) 14%, white);
}

.intro-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(0.4rem, 1vw, 1rem) 0.15rem;
}

.intro-title {
  font-size: clamp(1.8rem, 2.8vw, 2.55rem);
  margin: 0.45rem 0 1rem;
  color: #18335f;
}

.personal-touch {
  margin: 1.6rem 0 0;
  padding-top: 0.4rem;
  color: #728199;
  font-size: 0.9rem;
  font-weight: 350;
  line-height: 1.75;
  max-width: 72ch;
}

.hover-keyword {
  color: #5e6f89;
  border-bottom: 1px dashed color-mix(in srgb, #5e6f89 30%, transparent);
  cursor: pointer;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.hover-keyword:hover,
.hover-keyword:focus-visible {
  color: #415977;
  border-bottom-color: color-mix(in srgb, #415977 55%, transparent);
}

.music-hint-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
}

.music-hint-text {
  font-size: 0.76rem;
  color: #8a96a8;
  white-space: nowrap;
}

.music-hover-hint {
  display: inline-flex;
  margin-left: 0;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.76rem;
  font-family: inherit;
  color: #8a96a8;
  border: 1px solid color-mix(in srgb, #8a96a8 35%, transparent);
  border-radius: 999px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.music-hover-hint:hover,
.music-hover-hint:focus-visible {
  color: #5f6f86;
  border-color: color-mix(in srgb, #5f6f86 45%, transparent);
  background: color-mix(in srgb, #5f6f86 7%, white);
}

.music-hover-hint[aria-pressed="true"] {
  color: #4f637d;
  border-color: color-mix(in srgb, #4f637d 50%, transparent);
  background: color-mix(in srgb, #4f637d 10%, white);
}

.interests-shell {
  margin-top: 1rem;
}

#research-interests {
  color: #18335f;
  font-size: 1.34rem;
}

.interests-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.interest-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}

.interest-card img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d9e2f5;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.interest-card h3 {
  margin: 0.7rem 0 0.35rem;
  font-size: 0.96rem;
  line-height: 1.3;
}

.interest-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.card-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.05rem;
}

.section-card p {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.music-card,
.music-module {
  background: linear-gradient(140deg, #ffffff 0%, #f7f9fe 100%);
}

.music-link {
  color: #64748b;
  font-size: 0.95rem;
}

.about-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.4rem;
  margin-top: 1.2rem;
}

.profile-frame {
  margin: 0;
}

.profile-frame figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.timeline {
  position: relative;
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 1rem 1.2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 105px;
  top: 0.1rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(180deg, #bfd0f7 0%, #d9e4fb 100%);
}

.timeline-year {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  font-weight: 650;
  color: var(--accent);
  line-height: 1;
}

.timeline-year::after {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-coral) 70%, #7c9ce0);
}

.timeline-card {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem 0.95rem;
}

.meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.publications-shell h1 {
  margin-bottom: 0.5rem;
}

.publications-shell .timeline h2 {
  font-size: 1.1rem;
}


.section-main-title {
  font-size: clamp(1.72rem, 2.5vw, 2.2rem);
  color: #18335f;
}

.meta-link {
  margin-left: 0.5rem;
  white-space: nowrap;
}

.pub-summary-text {
  margin: 0;
}

.publications-shell .timeline p,
.publications-shell .timeline .meta,
.cv-stack p,
.cv-stack .meta {
  font-size: 0.92rem;
}

.cv-shell {
  padding: 0.15rem 0 0;
}

.cv-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.2rem;
}

.cv-block {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.cv-section-education,
.cv-section-proposals,
.cv-section-activities,
.cv-section-teaching {
  border-left: 0;
}

.cv-block h2 {
  color: #18335f;
  font-size: clamp(1.42rem, 2.2vw, 1.68rem);
  margin-bottom: 0.55rem;
}

.cv-block p {
  margin: 0.22rem 0;
}

.cv-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.62rem;
}

.cv-list-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.cv-entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  column-gap: 1.35rem;
  align-items: start;
}

.cv-date {
  text-align: right;
  white-space: nowrap;
  padding-top: 0.02rem;
}

.cv-entry-content {
  min-width: 0;
}

.cv-detail {
  margin-left: 1.2rem !important;
  color: var(--muted);
  font-style: italic;
}

.cv-proposal-list {
  margin-top: 0.7rem;
}

.event-type {
  font-weight: 700;
}

.event-poster {
  color: var(--accent-mint);
}

.event-talk {
  color: var(--accent-mint);
}

.contact-list p {
  margin: 0.35rem 0;
  font-size: 0.92rem;
}

.page-pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-pagination a {
  text-decoration: none;
  color: var(--accent);
}

.page-pagination a:hover,
.page-pagination a:focus-visible {
  color: var(--accent-mint);
}

@keyframes blossomFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(var(--emoji-scale, 1));
  }
  20%,
  75% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -105%) scale(calc(var(--emoji-scale, 1) * 1.03));
  }
}

@keyframes ballBounce {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(var(--emoji-scale, 1));
  }
  25% {
    opacity: 0.8;
    transform: translate(-50%, -12%) scale(calc(var(--emoji-scale, 1) * 1.02));
  }
  55% {
    opacity: 0.8;
    transform: translate(-50%, -58%) scale(calc(var(--emoji-scale, 1) * 0.98));
  }
  85% {
    opacity: 0.55;
    transform: translate(-50%, -25%) scale(var(--emoji-scale, 1));
  }
}

@keyframes noteSway {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-6deg) scale(var(--emoji-scale, 1));
  }
  25%,
  70% {
    opacity: 0.78;
  }
  50% {
    transform: translate(-45%, -56%) rotate(7deg) scale(calc(var(--emoji-scale, 1) * 1.03));
  }
  100% {
    opacity: 0;
    transform: translate(-52%, -48%) rotate(-5deg) scale(var(--emoji-scale, 1));
  }
}

@keyframes gentleFade {
  0% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.72;
  }
  100% {
    opacity: 0.08;
  }
}

@media (max-width: 980px) {
  .home-intro,
  .interests-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    text-align: left;
  }

  .profile-visual-wrap {
    margin: 0;
  }

  .mini-links {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .timeline::before,
  .timeline-year::after {
    display: none;
  }

  .timeline-year {
    justify-content: flex-start;
    margin-top: 0.5rem;
  }

  .cv-detail {
    margin-left: 0.7rem !important;
  }

  .cv-entry {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
  }

  .cv-date {
    text-align: left;
  }
}

@media (max-width: 700px) {
  .nav-wrap {
    align-items: flex-start;
    padding: 0.65rem 0;
    flex-direction: column;
  }

  .page-shell {
    padding-top: 2.2rem;
  }
}
